This chapter covers the Flyweight pattern.
GoF Definition
It uses sharing to support large numbers of fine-grained objects efficiently.
Concept
This pattern may look simple but if you do not identify the core concepts, the implementations may appear to be complex. So, I’ll start with a very basic and detailed explanation before you implement this pattern. Let’s start.
Sometimes you need to handle lots of objects that are very similar (but not the same). But the constraint is that you cannot create all of them to lessen resource ...