That's a legitimate question and I fully expected it to come up as I asked this to myself in the first place.
Actually, there are several reasons why this makes sense: 1) you don't have to include the MyModel class file first, or add it to autoload.ini 2) you can easily change your model to be a singleton (or not to be one anymore) without changing the code that retrieves the model 3) you have a $this->getContext() method But most importantly: 4) it's consistent with the rest of your code! You're retrieving all of your models through one standardized way - David P.S: there's not much harm in adding this functionality; I expect the performance impact to be minimal, since it's just a few lines of code changed > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Mike Vincent > Sent: Monday, June 27, 2005 2:08 PM > To: Agavi Development > Subject: Re: [agavi-dev] Singleton Models > > I guess the overwhelming question that comes to my mind here is, why? > By virtue of being a singleton, the model has become globally > accessible. What does it change to get an instance through the > framework's get(Global)Model() call vs MyModel::getInstance() ? > > -Mike > _______________________________________________ > 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
