Jump to content

Suggestions for a better module architecture


Recommended Posts

I am aware that 1.5 is too close to completion to make drastic changes to the architecture, but I am hoping we can start a discussion on the module architecture that could affect the future releases, perhaps 1.6. I have not gone trough the 1.5 source too much in detail, so a few of these could be less relevant now.

  • In my opinion the existing architecture uses the file system too much, this should be reduced. The database should be used to store as much module specific data as possible. The config file should only be used during installation and check for updates, and the data should be stored in the database. Any overhead this could create in the database would be less than what it would
  • We might also look into using the database to store language data as well. The idea should be to contain all data in the database and only the code in the filesystem. That is afterall what the file system is for. What I can think of is to use a pre-rendering without the translations and extract all translated strings at once just before the final rendering. This should improve the performance.
  • Common installation tasks such as hook registrations and overrides should be relocated to the config file. With a standard format, the hooks a module needs and the ones that can be hooked optionally should all be stored in the config file. The module class should register/unregister these hooks during install and uninstall automatically.
    The config file should also contain module specific configuration parameters, these will be defined in the config file and stored in the database using the existing config class. These parameters would have a name, a default value, a type (text, int, multiple select) for editing etc.
  • A better override system would contain the module specific code within the module itself. There might always be a need to use override files in extreme cases, but the goal should be to use the module file as much as possible. I am working on a solution that could add some kind of a dynamic hook programatically via the existing override system. I am hoping to share it in the existing topic about this (http://www.prestasho...verride-system/)

I think these changes would greatly improve the existing module system, improving the performance quite a bit.

Edited by whitelighter (see edit history)
  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...