Structural patterns
Flyweight
Saves memory by sharing immutable state between thousands of small objects.
Article
Flyweight – how to fit 60,000 stadium seats in memory
Flyweight separates the state shared by many objects from the state unique to each one, and shares the former. A stadium seat map example from a ticket booking system in C#, TypeScript, Java, Go and Python.
Around the topic
- Flyweight · Design Patterns Revisited · Game Programming Patterns article · web · Robert Nystrom
- Flyweight article · web · Refactoring.Guru
- Habrador/Unity-Programming-Patterns repo · github · Habrador
- Design Patterns: Elements of Reusable Object-Oriented Software book · openlibrary · Erich Gamma, John Vlissides, Richard Helm, Ralph Johnson
- Game Programming Patterns book · openlibrary · Robert Nystrom
- Pyłek / Flyweight article · web · Refactoring.Guru