创建型模式
Software Architecture & Engineering · 6 notes
- Singleton Patternhistorical
The singleton pattern restricts a class to one instance. Implementation examples examine how that instance is created and accessed.
- Factory Methodhistorical
Factory methods delegate concrete-product creation to corresponding factories so callers depend on a creation interface. These notes compare them with simple factories through code.
- Builder Patternhistorical
The builder pattern assembles objects with multiple parts and complex construction steps, using a builder to organize construction.
- Prototype Patternhistorical
When object creation requires substantial preparation, an existing object can be copied and adjusted. These notes introduce the prototype pattern through that idea.
- Abstract Factory Patternhistorical
An abstract factory creates families of related products. These notes examine factory responsibilities through scenarios requiring multiple product components.
- Simple Factory Patternhistorical
A simple factory separates object creation from usage, selecting and creating concrete instances. These notes illustrate that division through examples.