2. Introduction to design patterns
What is a singleton design pattern
Dissecting the classic singleton pattern implementation
Dealing with Multithreading
3. A description of an object-oriented
design technique which names, abstracts
and identifies aspects of a design structure that ar
e useful for creating an object
oriented design. The design pattern identifies class
es and instances,
their roles, collaborations and responsibilities. Eac
h design pattern focuses on a particular object-
oriented design problem or issue. It describes when
it
applies, whether it can be applied in the presence o
f other design
constraints, and the consequences and trade-
offs of its use.
4. The singleton pattern ensures a class has only one instance and
provides a global point access to it .
Look at this
diagram
5.
6. We obviously ensure that the singleton works in the presence of multithreads .
Has two status
Lock
unlock