I suggest this book to you: https://www.packtpub.com/zend-framework-1-8-web-application-development/book
In the book the author builds a web application, but not in an easy way.
It really explains design descisions and ways to solve common problems.
So far it helped me a lot.
On Sun, Aug 22, 2010 at 9:47 AM, Marko78 <marko.korhonen@gmail.com> wrote:
Hi,
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
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Centralized-Stack-Broker-or-something-for-Models-tp2333975p2334018.html
-----
br,
--------------------------
Marko Korhonen
Technical Consultant
--
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论