zend models architecture -


Assume that my database has two tables: projects and users I create two models, which is Zend_Db_Table_Abstract: < Expands code> Model_DbTable_Users and Model_DbTable_Projects .

Now, is it a good format to make an example of Model_DbTable_Projects inside Model_DbTable_Users class? In other words: Is it ok to put any arguments in this model, or I should create another category, which uses Model_DbTable_Users and Model_DbTable_Projects

>

Use to insert all the arguments in the I model, which increases the Zend_Db_Table_Abstract, but in large projects this code can be very impure. So, can you give me some advice on model architecture (links on articles will be great!).

I had Project Lead for the Zend Framework Project through version 1.0. My contribution was mainly in the Zend_Db component.

I often have to use patterns and people should avoid the antipaton. Remember that No table is a model.

Your model is such a class (does not raise a base class) that extends the logic of your business. The relationship between model and a table is not IS-A, it is HAS-A (or is-very). The model behaves firmly on the database as an implementation description. The model's consumer should not have any clue about your database structure (this allows you to change the database structure without changing the model's interface).

I am repeating the answer I originally gave.

There is more reading here:

< / Html>

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -