The Factory Pattern
summary
Explains a concrete claim: use a factory method to centralize creation and an extensible factory that stores name→callback pairs so new types register at run time via register_object and a map of creation callbacks GitHub code is provided and examples return shared or unique pointers Level files drive creation, per-class static counters report counts and the pattern appears in Ogre Blender Quake3 and Command and Conquer code bases with trade offs around parameters switch updates and pointer choice
AI-written summary · about
chapters (27)
- 0:00Start
- 0:30The Factory Pattern
- 1:41How Did Folks Get Started in Programming
- 4:37The Design Pattern
- 12:08Make Object
- 18:16Design Patterns
- 19:59What Is a Creational Design Pattern
- 21:21Inheritance
- 22:11Object Inheritance Hierarchy
- 23:09Inheritance Hierarchy
- 24:44Create Objects
- 28:50Game Object Collection
- 30:51The Factory Methods
- 32:23Great Way To Hide Implementation Details for the Derived Class
- 32:41Header File
- 34:02Implementation Question
- 36:30The Builder Pattern
- 38:46Extensibility
- 40:47Tracking Our Object Counts
- 42:41Game Object Factory
- 43:58Create Object Callback
- 48:37Is the Pattern Actually Used
- 51:06Recap
- 52:43Conclusion
- 53:19Abstract Factory Pattern
- 54:22Questions
- 56:09Type Object Pattern
related talks
50mDesign Patterns: The most common misconceptions
36mBuilding Strong Code Through Patterns
29mA Design Pattern Goes to the Supermarket
24mA Few Good Design Patterns
15mYou Might Not Need Classes
57mDesign Patterns - The Most Common Misconceptions (2 of N)
01h 02mThe Observer Design Pattern in Cpp
02h 14mDesign Patterns Workshop
