Save India From Corruption - Anna Hazare.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Save India From Corruption - Anna Hazare.
Regards
Salil Verma
To err is human,
To forgive is not company policy
As to the post that singleton is considered a bad practice no comments
If you really need the concept of a singleton than there are better ways to handle resource management for example. They will save you a lot of trouble.
Regards
Salil Verma
We can prevent this by keeping the following section in a synchronized block but this would create an performance overhead.
Could you please suggest what can be an alternate way to implement the singleton concept ?
Kengkaj Sathianpantarit wrote:We aren't allowed to create a instance directly because the constructor is private or protected so we have to use a public static method to get the instance.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |