Use the Flyweight pattern when…


There are:

  • Many objects to deal with in memory
  • Different kinds of state, which can be handled differently to achieve space savings
  • Groups of objects that share state
  • Ways of computing some of the state at runtime

You want to:

  • Implement a system despite severe memory constraints