Intent
Use sharing to support large number of fine-grained objects efficiently.
Applicability
- an application uses large number of objects
- object state can be made extrinsic
Structure
[to do: diagram with Client, Flyweight, FlyweightManager]
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
Uses in JHotDraw