Posted 10/13/10 08:15:00 am
Pattern Name: Singleton pattern
Type: Creational
The singleton pattern is one of the most common, basic patterns and provides a great introduction to both the creational design patterns as well as design patterns in general. However, it is also one of the more debatable patterns based on certain aspects of decoupled code (which we will discuss).
The Pattern
The singleton pattern typically applies directly to a class and is used to ensure that only one instance of that class exists throughout the entire project. Let's look at an example before we go any deeper:
Comments
Post a Comment