- Improving our singleton to make shutdown explicit
9
- Not storing our instance in static storage
10
- Removing lazy loading to make initialization explicit
11
- The "global" situation - my solution
Description:
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Grab it
Explore the drawbacks of using singletons in software development through this comprehensive video tutorial. Delve into the concept of singletons and their context, examining lazy loading and the reasons why singletons are often considered problematic. Compare singletons to global variables and review Meyers' Singleton implementation. Learn techniques to improve singleton design, including making shutdown explicit, avoiding static storage for instances, and removing lazy loading for explicit initialization. Discover the presenter's solution to the "global" situation and gain insights into alternative approaches for managing shared resources in your code.
Why I Don't Like Singletons - Drawbacks and Alternatives