MVC
From FreemedDeveloperWiki, the FreeMED developers' Wiki.
Post 0.8.x, there is a project to redesign the data model of FreeMED to more closely mimic the Model-View-Controller architecture which is commonly associated with web-based applications.
Contents |
Module redesign
Old design
As of the 0.8.x series, FreeMED modules contain the following tasks / objects / variables:
- UI (commonly referred to as View in MVC)
- SQL structure (part of Model)
- Logic (part of Model)
- Meta-information pertaining to the data and methods contained in the module
New design and segmentation
The "module" will not contain any UI or routines interpreting input from the user, but will instead be reduced to the equivalent of an API.
The current "module" table will be depreciated in favor of a second generation module table with more cached information available (the equivalent of the current data/cache/modules serialied data file). Updates will not be performed automatically, but will instead require an administrative step to activate table changes, etc to avoid race conditions which could have previously resulted from this
Model
The data model and all associated routines will remain in the module. An additional access control matrix will be put in place to allow strict access control by the phpgacl subsystem, while allowing direct access to the model from XML-RPC and other external webservices methods.
View
This will be handled by a superclass which will either interpret an XML file to provide this information, or will provide an alternative interface (DHTML/JS, Flash, etc). No information regarding the UI will be stored in the classic "module" in the modules/ subdirectory.
Controller
All data collection / expansion will take place outside of the modules, and will be controlled by a centralized facility, where it will be fed into the View and Model where necessary.