|
Posted by Michael Fesser on 12/01/06 21:38
..oO(Jerry Stuckle)
>Michael Fesser wrote:
>
>> In my scripts I use a global application object, which is implemented as
>> a singleton. This application object uses a lot of child objects, for
>> example the db handler, configuration (registry), authentication, error
>> handling/logging, sitemap and all that stuff.
>
>I just don't like to use global objects. I'd rather just have the
>singleton class and those which need access to it can get it.
Yep.
>That way I don't have to worry about defining it as a global, among
>other things.
As said: My application object is implemented as a singleton and
controls and maintains all the app-specific stuff. For example when
I need access to the database somewhere, I get the db object with
$db = TApplication::getInstance()->database;
Micha
[Back to original message]
|