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

Reply via email to