Polski

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

In this group: Structural patterns