Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Singleton design pattern


Published on

Describing design patterns and with details enough about Singleton Design pattern in C#

Published in: Software
  • Be the first to comment

  • Be the first to like this

Singleton design pattern

  1. 1. Amr Fathy
  2. 2.  Introduction to design patterns  What is a singleton design pattern  Dissecting the classic singleton pattern implementation  Dealing with Multithreading
  3. 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. 4.  The singleton pattern ensures a class has only one instance and provides a global point access to it . Look at this diagram 
  5. 5.  We obviously ensure that the singleton works in the presence of multithreads . Has two status Lock unlock
  6. 6. Amr Fathy