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" <[email protected]>
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
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-docs

_______________________________________________
wp-docs mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-docs

Reply via email to