Reply to Re: real world singleton class example?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация