Design patterns in Javascript : Singleton

March 6, 2011 by nuno costa no comments

 

The singleton patterns was documented as a solution to a simple problem, “Only one object of class X can be instantiated at any time in the application”

Typically a singleton is implemented by restricting access to the class constructor, effectively making impossible to instantiate the class

It is common to use singletons for application wide configuration or database access classes.

continue reading »

More from francodacosta.com

© francodacosta.com - All rights reserved