Singleton design pattern is the first design pattern I learned (many years back). In early days when someone asks me, “do you know any design pattern?” I quickly and promptly answer “I know singleton design pattern” and the question follows, “do you know anything other than singleton” and I stand stumped!
There are only two points in the definition of a singleton design pattern,
There are only two points in the definition of a singleton design pattern,
- there should be only one instance allowed for a class and
- we should allow global point of access to that single instance
No comments:
Post a Comment