Retiring the Singleton Pattern
© 2020 Bloomberg Finance L.P. All rights reserved. Retiring the Singleton Pattern Concrete suggestions for what to use instead CppCon 2020 September 18, 2020 Peter Muldoon Senior Software DeveloperBloomberg com/watch?v=-FRm3VPhseI What’s currently out thereTalk outline 1. Examine the Singleton Pattern 2. Refactoring out the Singleton in an example function • Ensuring the callers of that function do not need with groups of Singleton dependencies 8. Stateful groupings of dependencies 9. Review of covered topics & Questions Bloomberg 5Classic Singleton class Singleton { public: static Singleton* instance()0 码力 | 70 页 | 1.59 MB | 5 月前3Spring Framework 1.1.3 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 37 3.19. Glue code and the evil singleton .......................................................................................... 38 3 ................ 72 6.2.1. "Singleton" aspects .................................................................................................... 72 6.2.2. Non-singleton aspects ....................0 码力 | 203 页 | 1.15 MB | 1 年前3Spring Framework 1.1.2 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 36 3.18. Glue code and the evil singleton .......................................................................................... 37 3 ................ 71 6.2.1. "Singleton" aspects .................................................................................................... 71 6.2.2. Non-singleton aspects ....................0 码力 | 199 页 | 1.14 MB | 1 年前3Spring Framework 1.1.1 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 34 3.16. Glue code and the evil singleton .......................................................................................... 34 3 ................ 67 6.2.1. "Singleton" aspects .................................................................................................... 67 6.2.2. Non-singleton aspects ....................0 码力 | 194 页 | 1.12 MB | 1 年前3Spring Framework 1.2.1 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 39 3.20. Glue code and the evil singleton .......................................................................................... 40 3 ................ 75 6.2.1. "Singleton" aspects .................................................................................................... 75 6.2.2. Non-singleton aspects ....................0 码力 | 244 页 | 1.30 MB | 1 年前3Spring Framework 1.2.0 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 38 3.20. Glue code and the evil singleton .......................................................................................... 39 3 ................ 74 6.2.1. "Singleton" aspects .................................................................................................... 74 6.2.2. Non-singleton aspects ....................0 码力 | 243 页 | 1.29 MB | 1 年前3Spring Framework 1.1.5 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 38 3.19. Glue code and the evil singleton .......................................................................................... 38 3 ................ 72 6.2.1. "Singleton" aspects .................................................................................................... 72 6.2.2. Non-singleton aspects ....................0 码力 | 223 页 | 1.22 MB | 1 年前3Back to Basics: Design Patterns
and why you should study them ● Pragmatically ○ How to implement/use a Creational Pattern ■ Singleton in C++ ○ How to implement/use a Structural Pattern ■ Adapter in C++ ○ How to use a Behavior Pattern and why you should study them ● Pragmatically ○ How to implement/use a Creational Pattern ■ Singleton in C++ ○ How to implement/use a Structural Pattern ■ Adapter in C++ ○ How to use a Behavior Pattern (e.g. we may use windowWidth and windowHeight to compute an aspect ratio)Singleton A Creational Design Pattern 33Singleton Enforces the existence of only one instance of an object being created 340 码力 | 96 页 | 2.10 MB | 5 月前3Spring Framework 1.2.2 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 40 3.20. Glue code and the evil singleton .......................................................................................... 41 3 ................ 76 6.2.1. "Singleton" aspects .................................................................................................... 76 6.2.2. Non-singleton aspects ....................0 码力 | 269 页 | 1.41 MB | 1 年前3Spring Framework 1.2.6 Reference
....................................................................... 10 3.2.5. To singleton or not to singleton .................................................................................. 10 application ........................................................ 40 3.20. Glue code and the evil singleton .......................................................................................... 41 3 ................ 83 7.2.1. "Singleton" aspects .................................................................................................... 83 7.2.2. Non-singleton aspects ....................0 码力 | 290 页 | 1.49 MB | 1 年前3
共 874 条
- 1
- 2
- 3
- 4
- 5
- 6
- 88