Creational patterns
Factory Method
Define a method for creating an object, but let SUBCLASSES decide which concrete class to instantiate, so the creator code never names a product directly. An animated lesson where the diagram draws itself as the design grows.
- Lesson 2 of 5
- Animated diagrams
Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.
Creational patterns
What you will learn
- The problem: new ConcreteX() everywhere
- The Factory Method
- Not the same as a simple factory
More low-level design
Watch Factory Method take shape
Sign in and the lesson opens with its diagram ready to play, and the rest of Creational patterns beside it.
DSA comes with the all labs plan and every ChaiCode batch.