I also use my models this way (init method in controllers). But I have so
many other places where models are used.
For example:
We are in news module (News_IndexController and listAction):
News_Model_Article is instantiate in init method of News_IndexController.
All fine.
So my list will have 10 News_Model_DbTable_Row_Article row objects. So all
news articles have author aka user. So in my row object I have method
getAuthor() which will instantiate new User_Model_User and get user by it's
method getUser($id). So every news article row will make it's own instance
of User_Model_User model which seems vain.
br, Marko
-----
br,
--------------------------
Marko Korhonen
Technical Consultant
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Centralized-Stack-Broker-or-something-for-Models-tp2333975p2334018.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论