Post by rph » Thu Aug 18, 2011 3:01 am

affect wrote:
Out of curiosity, why do you think this is an issue? The only time I can see this adding work is if you want to make a change outside the extension.
Not really outside, mostly when splitting module config into parts. Let's say I have a module that has multiple logical configuration parts, for example it has some configuration variables, positions (layouts) and beside that it lists and allows adding/removing records from the database.
Why not just break it into tabs like OpenCart does for products or store settings?

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by SapporoGuy » Thu Aug 18, 2011 3:16 am

I don't think that this idea is about layout but rather how the database is actually setup (not sure if this is the right word).

[setup? designed?
Basically trying to find the word that describes how you actually decide what database type and if use indexes, and/or foreign keys.]

Something like this comes across as very minor and actually non-relevant in most cases but this is being caused by a much larger issue of how the mysql db class and database is designed.

However, I can see that fixing this would be a huge undertaking! Thereby, loosing the ability to replace is a very fair trade off.

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by JAY6390 » Thu Aug 18, 2011 3:27 am

The word you're looking for is database SCHEMA

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by SapporoGuy » Thu Aug 18, 2011 3:32 am

ugh!

Thanks! 8)

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by Qphoria » Thu Aug 18, 2011 3:35 am

yea.. universal model functions would be good

Code: Select all

function updateTable($table, $column, $value, $clause) {
    $this->db->query("UPDATE " . DB_PREFIX . "$table SET `" . $column . "` = '" . $value . "' WHERE " . $clause);
}

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by affect » Thu Aug 18, 2011 3:35 am

rph wrote:Why not just break it into tabs like OpenCart does for products or store settings?
Actually I haven't looked at how tabs are coded yet, but that might be a great idea (if it doesn't split the module into even more files. It was a pain for me coding modules in the OC mvc+l way, actually, got used to Presta's way of separating modules from the core architecture and making it available to put all belonging files in one folder).

I'll check tabs out when I return from my trip next week, thanks.

MultiMerch Marketplace for OpenCart

Image


User avatar
Active Member

Posts

Joined
Sat Aug 13, 2011 5:04 pm


Post by JAY6390 » Thu Aug 18, 2011 3:36 am

Tabs are one file, with the content of each tab in <div>'s generally

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Qphoria » Thu Aug 18, 2011 3:38 am

tabs are just dhtml ocular trickery
its really just one single page and one single form

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SapporoGuy » Thu Aug 18, 2011 3:40 am

Tabs will help you organize your pages better, but I don't seem to recall them being individual entities within the main section. So, you still need to do delete and add.

MVC vs monolithic is another topic on it's own.
Personally, monolithic is like php3 :bang:
However, a monolithic structure does allow you to do plugins relatively easy. But then again, this can be done with MVC if the bootstrapper/main controller was built that way.

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by affect » Thu Aug 18, 2011 3:48 am

Personally, monolithic is like php3
However, a monolithic structure does allow you to do plugins relatively easy. But then again, this can be done with MVC if the bootstrapper/main controller was built that way.
Yep, that's kind of how it's done in Presta. Modules are still mvc-like, although the files are stored in a same folder which makes it easy to develop and add/delete. Really convenient.

MultiMerch Marketplace for OpenCart

Image


User avatar
Active Member

Posts

Joined
Sat Aug 13, 2011 5:04 pm


Post by Qphoria » Thu Aug 18, 2011 3:54 am

affect wrote:
Personally, monolithic is like php3
However, a monolithic structure does allow you to do plugins relatively easy. But then again, this can be done with MVC if the bootstrapper/main controller was built that way.
Yep, that's kind of how it's done in Presta. Modules are still mvc-like, although the files are stored in a same folder which makes it easy to develop and add/delete. Really convenient.
Agreed, hence my restructure proposal in OpenCart 2.0
http://forum.opencart.com/viewtopic.php?t=28787

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by rph » Thu Aug 18, 2011 5:59 am

The problem with that is it pretty much kills any practical sharing of functions. You'd end up putting duplicate code in all over the place.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by Qphoria » Thu Aug 18, 2011 12:00 pm

rph wrote:The problem with that is it pretty much kills any practical sharing of functions. You'd end up putting duplicate code in all over the place.
Well this doesn't really cover core libraries, only had Extensions in mind for this. Extensions are self-contained anyway. If it is done right, extensions would not even be in the same area as core libraries and they could be structured however they like.

And don't get me started on duplicate code..considering the mess of dupe code we have already. Trust me that's the last thing I want.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by boriscm » Thu Aug 25, 2011 10:35 pm

Hi,

Was thinking about the OpenCart release cycle, and i think this model would greatly benefit the process.

HotFixes are go :)


http://nvie.com/posts/a-successful-git-branching-model/
https://github.com/nvie/gitflow

What u guys think?
Greetings
boriscm

New member

Posts

Joined
Fri Feb 12, 2010 6:23 pm

Post by daemonsy » Wed Aug 31, 2011 4:30 pm

Hi guys,

Sorry I'm a new programmer trying to write my own modules. I'm trying to learn more about Opencart's setting table and saw this line of code.

Code: Select all

	$this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '" . (int)$store_id . "' AND `group` = '" . $this->db->escape($group) . "'");

	foreach ($data as $key => $value) // Code for inserting continues here.
I don't know if I understood the code correctly. Does this mean that everytime you save the settings, the old settings are deleted before the new settings are entered?

Is there a possibility that this will cause a scenario where after the delete is done, the insert fails due to some reason and you lose the settings?

Newbie

Posts

Joined
Wed Jul 13, 2011 4:33 pm
Who is online

Users browsing this forum: No registered users and 5 guests