On Java Development

All things related to Java development, from the perspective of a caveman.

Singleton Design Pattern

without comments

Probably the simplest of design patterns, the so-called Singleton ensures one single instance of a class exists. The method presented is guaranteed to execute only once ensuring there is only one instance created (and is thread-safe).

The Java Language Specification (JLS) guarantees the object “instance” would not be initialised until someone calls getInstance() method.

Wiki on Initialization on Demand Holder pattern

Written by admin

January 6th, 2014 at 8:10 pm

Leave a Reply

You must be logged in to post a comment.