• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Design Patterns | Flyweight
  1. References
  2. Example
    • The Flyweight
    • The Factory
    • A simple class to test the Flyweight design pattern

  1. References
    • Definition: (source: http://en.wikipedia.org/wiki/Flyweight_pattern)

      A flyweight is an object that minimizes memory use by sharing as much data as possible with other similar objects; it is a way to use objects in large numbers when a simple repeated representation would use an unacceptable amount of memory.
  2. Example
    • The Flyweight:


    • The Factory:


    • A simple class to test the Flyweight design pattern:


© 2025  mtitek