创建型模式
Software Architecture & Engineering · 6 notes
- Singleton Patternhistorical
A class has one and only one instance, with Java and Go implementations including eager, lazy, DCL, static-inner-class, enum, mutex, and sync.Once approaches.
- Factory Methodhistorical
The factory-method pattern uses multiple factory classes and delays concrete product creation to subclasses.
- Builder Patternhistorical
The builder pattern constructs a complex object from many smaller parts; the builder creates the parts and the director assembles them.
- Prototype Patternhistorical
Prototype-pattern notes with UML, Java and Go clone examples, plus a generic DAO example that returns cloned data.
- Abstract Factory Patternhistorical
Abstract-factory notes showing related product families and a Go implementation with engines, wheels, factories, and a client.
- Simple Factory Patternhistorical
Simple-factory notes in Java and Go, followed by a generic template-method + simple-factory + strategy example.