© Vaskaran Sarcar 2020
V. SarcarDesign Patterns in C#https://doi.org/10.1007/978-1-4842-6062-3_10

10. Flyweight Pattern

Vaskaran Sarcar1 
Garia, Kolkata, West Bengal, India

This chapter covers the Flyweight pattern.

GoF Definition

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


This pattern may look simple, but if you do not identify the core concepts, the implementations may appear to be complex. Let’s start with a basic but detailed explanation before you implement this pattern.

Sometimes you need to handle lots of objects that are very similar but not exactly the same. The constraint is that you cannot create all of them to lessen resource and memory usage. The Flyweight pattern is made to handle these scenarios. ...

Get Design Patterns in C#: A Hands-on Guide with Real-world Examples now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.