Flyweight (cont’d)
Consequences
- reduction of the total number of instances
- can’t rely on object identity
Implementation
- Flyweight manager maintains instantiated Flyweights
- Flyweights have to be immutable
- Context information is often maintained by parent object
Known Uses
- Interviews: Doc
- AWT: LayoutManagers