Results 1 to 2 of 2
Thread: using singleton pattern in java
- 12-16-2009, 09:13 AM #1
Member
- Join Date
- Dec 2009
- Posts
- 3
- Rep Power
- 0
- 12-16-2009, 02:57 PM #2
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
This are common situations where you need only one of kind object:
DB connection pools, all kind of thread pools, object that work with drivers for devices,
objects that has to manage concurrent work with shared resources,
logging service is typical example,
reading conf file at program start-up that has to be read only once.
If you create more than one of this objects,
it can lead you to overuse of some resource that is limited,
or incorrect and inconsistent results and states in your logic.
Looking from outside world, every module or part of application will use
Singleton class exactly the same way, and in all scenarios only one instance
of this class is ever needed. They have global access nature.
regards:)
Similar Threads
-
[SOLVED] Hacking Singleton- Multiple instance of a Singleton class
By piyu.sha in forum New To JavaReplies: 2Last Post: 10-06-2008, 09:06 PM -
Singleton Pattern
By Java Tip in forum Java TipReplies: 0Last Post: 01-24-2008, 03:21 PM -
singleton pattern
By Peter in forum Advanced JavaReplies: 1Last Post: 07-09-2007, 04:45 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks