[wp-docs] Singleton Glossary Term

Jacob Santos wordpress at santosj.name
Tue Jan 20 14:03:52 GMT 2009


No. Singleton is not an object, it is a class pattern.

"Singletons are objects that exist globally and are the only one of 
their class." - Is correct

The rest is not. The Singleton class pattern puts constraints on exactly 
how many instances can be created, not the total number that are 
created, if that was the case then the majority of objects in WordPress 
would be Singletons because they are only created once. There are no 
Singletons in the WordPress library, actual all of the WordPress class 
library follows the normal object practices.

Searching Google for "Singleton object" only comes up with the Pattern. 
The Singleton is a pattern not an object, if anything it is a class 
methodology.

Jacob Santos

Michael E. Hancock wrote:
>
> ----- Original Message ----- From: "Jacob Santos" 
> <wordpress at santosj.name>
>> If anyone wants to rewrite the glossary term to remove the erroneous 
>> example(s), then they can be my guest.
>>
>> Jacob Santos
>>
>>
>> [1] http://codex.wordpress.org/Glossary#Singleton
>
>
> Corrected the definition of Singleton to be:
>
> "Singletons are objects that exist globally and are the only one of 
> their class; if one instance of a class is created per request, this 
> instance is a singleton object. "
>
> MichaelH
>
>
> _______________________________________________
> wp-docs mailing list
> wp-docs at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-docs



More information about the wp-docs mailing list