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 youtube.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 types 4. Dealing with delayed construction 5. Dealing with phased introduction of the replacement pattern 6. Dealing with initialization order of interdependent Singletons 7. Dealing with groups of Singleton0 码力 | 70 页 | 1.59 MB | 6 月前3
Applicative: The Forgotten Functional Pattern1APPLICATIVE APPLICATIVE THE FORGOTTEN FUNCTIONAL PATTERN THE FORGOTTEN FUNCTIONAL PATTERN BEN DEANE / CPPCON / 2023-10-04 BEN DEANE / CPPCON / 2023-10-04 2DISCLAIMERS DISCLAIMERS No AI was used in just said that, now I'm not so sure… Don't worry about what apattern> Don't worry about what a pattern> isis.. Rather we'll think about Rather we'll think about what it does 106SPOT THE FUNCTIONAL PATTERN SPOT THE FUNCTIONAL PATTERN107SPOT THE FUNCTIONAL PATTERN SPOT THE FUNCTIONAL PATTERN108P2300 P2300 P2300 name What it does Functional pattern then transforms the value 0 码力 | 141 页 | 11.33 MB | 6 月前3
Back to Basics: The Factory Patternslide 1Please do not redistribute slides without prior permission. 2Software Design: Factory Pattern Mike Shah, Ph.D. @MichaelShah | mshah.io | www.youtube.com/c/MikeShah 2:00 pm MDT, Wed. October there is a common pattern that can help solve this problem--the factory design pattern. In this talk, we are going to discuss a creational design pattern known as a factory. The pattern can be as simple the factory pattern, and discuss which scenarios you may not actually want to use a factory. Attendees will leave this talk with the knowledge to go forward and implement the factory pattern, as well as0 码力 | 93 页 | 3.92 MB | 6 月前3
SuperCharge Your IPC Programs With C++20 and CCI Pattern0 码力 | 57 页 | 7.11 MB | 6 月前3
Extending and Simplifying C++: Thoughts on Pattern Matching using 'is' and 'as', and Can C++ be 10x Simpler0 码力 | 108 页 | 5.08 MB | 6 月前3
Design Patterns: Facts and Misconceptions(Template Method Design Pattern) Temporary-Swap Idiom RAII Idiom Pimpl Idiom (Bridge Design Pattern) Factory Function enable_if3233 ? ? ?34 ?The Classic Factory Method Design Pattern 35The Classic Factory Factory Method Design Pattern 36 “Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.” Design Patterns - Elements of Reusable Object- Oriented Software)The Classic Factory Method Design Pattern 37 virtual factoryMethod() = 0 Product Creator ConcreteCreator virtual factoryMethod() ConcreteProduct0 码力 | 88 页 | 17.31 MB | 6 月前3
Back to Basics: Design PatternsPragmatically ○ 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 ■ Iterator in C++ 6What you are going 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 ■ Iterator in C++ ● My expectations are So there has to be a better way... 20 Introducing--Design Patterns!Design Patterns 21Design Pattern (1/2) ● A common repeatable solution for solving problems. ○ Thus, Design Patterns can serve as0 码力 | 96 页 | 2.10 MB | 6 月前3
Conan 2.1 Documentationat all. Then it does not make sense that they affect to the package ID computation, so a typical pattern is to delete them in the configure() method: def configure(self): self.settings.rm_safe("compiler also packaging the LICENSE file from the library sources in the licenses folder. This is a common pattern in Conan packages and could also be added to the previous example using cmake.install() as the CMake- package_folder, ˓→"licenses")) copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os. ˓→path.join(self.package_folder, "include")) copy(self, pattern="*.a", src=self.build_folder, dst=os0 码力 | 694 页 | 4.13 MB | 1 年前3
Conan 2.5 Documentationdependencies (whenever possible) as shared libraries, we would use -o *:shared=True, with the * pattern that matches all package references. Let’s build the application again after configuring it to link at all. Then it does not make sense that they affect to the package ID computation, so a typical pattern is to delete them in the configure() method: def configure(self): self.settings.rm_safe("compiler also packaging the LICENSE file from the library sources in the licenses folder. This is a common pattern in Conan packages and could also be added to the previous example using cmake.install() as the CMake-0 码力 | 769 页 | 4.70 MB | 1 年前3
Conan 2.4 Documentationdependencies (whenever possible) as shared libraries, we would use -o *:shared=True, with the * pattern that matches all package references. Let’s build the application again after configuring it to link at all. Then it does not make sense that they affect to the package ID computation, so a typical pattern is to delete them in the configure() method: def configure(self): self.settings.rm_safe("compiler also packaging the LICENSE file from the library sources in the licenses folder. This is a common pattern in Conan packages and could also be added to the previous example using cmake.install() as the CMake-0 码力 | 769 页 | 4.69 MB | 1 年前3
共 154 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16













