Re: [PHP] Static utility class?

[email protected] (Robert Cummings)
Newsgroups php.general
Organization InterJinn
Message-ID <[email protected]>
On 13-09-05 02:27 PM, Micky Hulse wrote:
> On Wed, Sep 4, 2013 at 11:07 PM, Robert Cummings <[email protected]> wrote:
>> I'll second Rodrigo's opinion, but would like to comment that the name of
>> the class is misleading since it's called "Singleton". The singleton pattern
>> is used when you only ever want one instantiation of a class. In your case
>> you are using static methods, the object never needs to be instantiated and
>> so it doesn't fit this pattern. What you are creating is far more consistent
>> with the utility pattern.
>
> Ahhh, thanks so much for the clarification and details! That's very helpful.
>
> I've updated my gist to reflect the pattern name:
>
> <https://gist.github.com/mhulse/6441525>
>
> Much appreciated. :)

Probably sufficient (and easier for typing) to just call it Utility 
since it follows the pattern but isn't the pattern itself :)

Cheers,
Rob.
-- 
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.