See. The flexibility of the framework has the consequence that everybody is
using it in a slightly different way. I don't abstract data; instead, I use
Propel. And for me, Models are a collection of business logic I can re-use
across different Actions. I have a Model that performs a search, or one that
allows me to add items to a navigation bar from within my Views. These are
singletons, since I want _one_ instance of the navigation manager. I used to
call them directly ($nav = NavigationManager::getInstance()), but with some
small mods, I can do $nav = Controller::getModel('backend',
'NavigationManager');- David P.S: yeah, Outlook is doing that, but only for this list, not for others. Weird. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of zimba-tm > Sent: Monday, June 20, 2005 8:13 PM > To: Agavi Development > Subject: Re: [agavi-dev] initialize() vs. __construct() > > I'm also learning at the same time. For me, the Model is the Object > abstraction of different datas, typically from a Database, but it can > also be from RSS feeds, ... > > For me, the idea of using Singletons is to avoid loading the data twice. > > What kind of Singletons do you build ? > > PS : I recieve your emails twice, once from the ML and once directly > > On 6/20/05, David Zülke <[EMAIL PROTECTED]> wrote: > > What does the Context have to do with a Model. > > > > $foo = Bar::getInstance(); > > $searchInstance = Search::getInstance(); > > $thing = MyHomegrownClass::getInstance(); > > > > Maybe I was using the wrong words, sorry for that. I want to be able to > > retrieve instances of models that are designed to be singletons. > > > > - David > > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On > > > Behalf Of zimba-tm > > > Sent: Monday, June 20, 2005 7:37 PM > > > To: Agavi Development > > > Subject: Re: [agavi-dev] initialize() vs. __construct() > > > > > > What I was refering to, is that $c = Context::getInstance() already > > > exists, and that you can store any informations with > > > $c->setAttribute(...). By this way you don't have to make tons of > > > singletons. Which is not a good practice IMO > > > > > > On 6/20/05, David Zülke <[EMAIL PROTECTED]> wrote: > > > > > A propos Singletons, the Context object is already there for that > > > > > purpose. You just need to put your objects in it and they should > be > > > > > accessable everywhere > > > > > > > > Care to elaborate? What I have in mind is that I can use > > > get(Global)Model > > > > even with singletons, i.e. getGlobalModel uses the classes' > > > getInstance() or > > > > whatever method instead of returning a new instance. > > > > > > > > - David > > > > > > > > > > > > _______________________________________________ > > > > agavi-dev mailing list > > > > [email protected] > > > > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev > > > > > > > > > > > > > -- > > > Cheers, > > > zimba > > > > > > http://zimba.oree.ch > > > _______________________________________________ > > > agavi-dev mailing list > > > [email protected] > > > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev > > > > > > > > _______________________________________________ > > agavi-dev mailing list > > [email protected] > > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev > > > > > -- > Cheers, > zimba > > http://zimba.oree.ch > _______________________________________________ > agavi-dev mailing list > [email protected] > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev _______________________________________________ agavi-dev mailing list [email protected] http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev
