So think of why this pattern is called a flyweight? The word “ flyweight-in software” is similar to the word “ flyweight- in boxing” in which flyweight refers to a lightweight boxing category. According to the GOF definition- “A flyweight is a shared object that can be used in multiple contexts simultaneously”.
Did I say “Limit the number of objects creation”? But we are living in an object oriented world how can we minimize the objects creation? So I will revisit the definition of flyweight. In a simple sentence flyweight pattern can be applied in situations where we want to limit the number of objects creation.
The flyweight design pattern although not widely used can be very helpful in scenarios where memory is a constraint. This article explains what is a flyweight design pattern and how we can implement it in C#.