Bluehost.com Web Hosting $6.95

Should I go with the Singleton Pattern or wait for 5.3?

This is a discussion on Should I go with the Singleton Pattern or wait for 5.3? within the PHP General forums, part of the PHP Programming Forums category; Hello, I'm planning out a simple project and most probably I will need the functionality provided by the Singleton ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-14-2008
Luigi Perroti
 
Posts: n/a
Default Should I go with the Singleton Pattern or wait for 5.3?

Hello, I'm planning out a simple project and most probably I will need
the functionality provided by the Singleton pattern.
However with the next 5.3 release I would be able to conveniently use
classes directly without instancing them.
This would be a comparable option thanks to late state binding and the
possibility to reference the class using a variable.

What path do you suggest I should take? I can wait for the 5.3 release
since I'm not in a hurry.
I would like to hear your opinions in particular regarding the
performance and code maintainability aspects.

Thanks for your time.
Reply With Quote
  #2 (permalink)  
Old 07-15-2008
Chris
 
Posts: n/a
Default Re: [PHP] Should I go with the Singleton Pattern or wait for 5.3?

Luigi Perroti wrote:
> Hello, I'm planning out a simple project and most probably I will need
> the functionality provided by the Singleton pattern.
> However with the next 5.3 release I would be able to conveniently use
> classes directly without instancing them.
> This would be a comparable option thanks to late state binding and the
> possibility to reference the class using a variable.
>
> What path do you suggest I should take? I can wait for the 5.3 release
> since I'm not in a hurry.
> I would like to hear your opinions in particular regarding the
> performance and code maintainability aspects.


Is this a decision for the whole project or just one particular part of
it? Can that one part be put off until later or does it need to be done
first?

--
Postgresql & php tutorials
http://www.designmagick.com/
Reply With Quote
  #3 (permalink)  
Old 07-15-2008
Luigi Perroti
 
Posts: n/a
Default Re: [PHP] Should I go with the Singleton Pattern or wait for 5.3?

On Tue, Jul 15, 2008 at 2:10 AM, Chris wrote:
>
> Is this a decision for the whole project or just one particular part of
> it? Can that one part be put off until later or does it need to be done
> first?
>


This decision will impact the whole project.

I think that maybe I should go with the Singleton pattern approach
since it should allow for easier/quicker refactoring in case I have to
switch to another object oriented pattern.

BTW, thanks for your other reply on the php-db list.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:10 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0