Files
design-patterns-cpp/flyweight
Jakub Vojvoda 67bc22c4ff update READMEs
2016-09-16 12:38:06 +02:00
..
2016-09-16 12:38:06 +02:00

Flyweight

Use sharing to support large numbers of fine-grained objects efficiently.

When to use

  • when all of the following are true
  • an application uses a large number of objects
  • storage costs are high because of the sheer quantity of objects
  • most object state can be made extrinsic
  • many groups of objects may be replaced by relatively few shared objects once extrinsic state is removed
  • the application doesn't depend on object identity