Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

Singleton class

The singleton design pattern allows to have one and only one instance of an object to be created within the whole application.

Ads

Singleton class

     

Singleton Design Pattern:

The singleton design pattern allows to have one and only one instance of an object to be created within the whole application. This can be achieved in java by making a Singleton  class

Benefits: 
Singleton pattern provides 
-- access only to the unique instances,
-- permits a variable number of instances, 
-- provides more flexibility than class operations. 
-- it reduces name space, and 
-- allows refinement of operations and representations, 

Usage: 
-- It is used only at those places where the user requires only one instance of a class to be operating through out the application. 
-- It is mostly used in the multi-threaded environments.
-- They often work as global variables permitting the allocation and initialization whenever required. 

Read more at:

www.roseindia.net/java/beginners/SingletonPattern.shtml

Advertisements

Ads

Online Training Classes

Share on Google+Share on Google+

Singleton class

Posted on: June 11, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Singleton class  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads