ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Using the Singleton Pattern
Subject:   Singleton Considered Harmful
Date:   2003-09-09 00:20:22
From:   anonymous2
Response to: Singleton Considered Harmful


From an enterprise application point of view,
There are often services which are deployed as singletons. For eg, JNDIlookUpDirectory of the application.

Only one instance manages the addresses in the directory.

The problem wiyth singleton, classes, is that they cannot be deployed in a clustered environment.

If deployed, only one instance of the clsuter will have this singletton class instantiated else it will fail.

In cases, where scalablity and failover is desired, singleton pattern offers a bottleneck.

Is there any work around for such singletons, already existing in this existing application.