10 Prove
Singleton Pattern
Objectives
Learn about the Singleton pattern.
Introduction
The Singleton pattern is a rather controversial pattern. On one hand, it is extremely useful, and is used quite a bit. On the other hand, when used incorrectly, the singleton pattern can lead to such bad design that some people refer to the singleton pattern as an anti-pattern.
Assignment
-
Read this overview of the Singleton pattern.
-
Read this Stack Overflow post about why singletons are often considered bad.
-
Take a look at this Stack Overflow post about when to use the Singleton pattern.
-
Aside from logging, another place where singletons are used quite often is with game development engines. If you're at all interested in game development, (this won't be on the quiz), take a look at this list of questions about Singletons from the Game Development Stack Exchange site.
Make sure to complete the accompanying quiz for this assignment on I-Learn.