Software Architecture & Engineering
82 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- Law of Demeterhistorical
What the Law of Demeter is, why it is needed, and how to reduce coupling by limiting what objects depend on and expose.
- Composition Reuse Principlehistorical
What the composition reuse principle is, why it is needed, and how composition or aggregation can be preferred over inheritance for code reuse.
- Object-Oriented Design Principleshistorical
What object-oriented design principles are, why they are needed, and the main principles covered by these notes.
- Object-Oriented Design Patternshistorical
What design patterns are and the three main categories: creational, structural, and behavioral.
- 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.
- Proxy Patternhistorical
The proxy pattern adds functionality around an existing class or function without changing the original code, with static, dynamic, AOP, Go, and cache-proxy examples.
- Template Methodhistorical
The template-method pattern applies when the overall algorithm steps are fixed while some parts vary, with Java and Go implementations and a combined template/factory/strategy example.
- Factory Methodhistorical
The factory-method pattern uses multiple factory classes and delays concrete product creation to subclasses.
- State Patternhistorical
The state pattern selects different processing logic according to the current state, with Java and Go examples.
- Builder Patternhistorical
The builder pattern constructs a complex object from many smaller parts; the builder creates the parts and the director assembles them.