There are so many PHP frameworks, that it’s time to keep track of them and keep comparitive reviews.
And a few other frameworks we can learn from:
One of the fundementals of a framework is the ability to work with a database. MVCLib uses an object to database mapping layer but there are several strategies in use, and the abilities of MVCLib could be enhanced. Here are useful links to other similar projects:
There are also db code generators:
Some notes: http://www.sitepoint.com/forums/showthread.php?t=214183
From [http://wiki.cc/php/Object_Relational_Mapping|PHP Wiki]]
And projects to learn from:
—-
The Python-based Django has an excellent discussion of their design principles.
Django uses MVC (I think). It has templates and an inheritance system for templates. Templates can be extended like in ColdFusion, with new tags.
Django stores the database description/schema in code, with one class per table - in Django this is the Model. The database can be created by the framework using the schema code. This also creates an API to the database, using the relationships you can define in the schema code. You are able to define ForeignKey (i.e. many-to-one relationships), ManyToManyField, OneToOneField and recursive/tree relationships. Django hides the details of SQL, but you are able to intercede with custom SQL.
You are able to attach metadata to a model. The metadata holds information about how the model can be used - for instance which fields can be ordered, or permissions for the table. You are able to add info about filtering options on lists. You can add in your own methods to the model class and validator methods.
After defining the Model, you generate code, which gives you classes for use with the Model. You automatically get a basic admin interface application into the database.
Django assumes a static database; there’s no way to upgrade a database, except by hand, and there’s no provision for runtime database alteration. An Agile development style is difficult when there’s no support for database change.
http://freshmeat.net/articles/view/843/ DB_Table - http://wiki.ciaweb.net/yawiki/index.php?area=DB_Table - DB_Table is an object-oriented interface to a database table. As a wrapper for the PEAR DB class, it provides methods to help you build automated create, insert, update, delete, and select functionality, and methods to automatically build input forms with HTML_QuickForm.