Reply to Re: Simple (?) Singleton Question

Your name:

Reply:


Posted by Radek N. on 11/16/07 06:46

Rob Wilkerson pisze:
> On Nov 14, 11:25 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Rob Wilkerson wrote:
>>
>> Rob,
>>
>> One of the things you may be missing is that web pages are basically a
>> transactional request system. That is, the client calls a web page.
>> That page opens the resources it needs, fetches them and closes the
>> resources. The web page (transaction) then ends (and frees all resources).
>>
>> The next page is another transaction and needs to do it's thing, also.
>>
>> This is very different from batch programs which can keep resources
>> available across requests to the UI. Those are running all the time,
>> and can maintain resources across multiple requests.
>>
>> It's a different style of programming, and if you're used to writing
>> batch programs, it takes a bit of getting used to the differences.
>
> I'm familiar with the stateless nature of the web, but am admittedly
> from a ColdFusion background where an application server was
> involved. I could created a singleton and store it in the application
> scope for persistence in memory and, in that way, ensure that I really
> *was* returning the same instance. I'm learning. :-)

Maybe you should use Registry Pattern?
http://www.patternsforphp.com/wiki/Registry

--
Radek N.

[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

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