Now, we will now get to know the Flyweight Design Pattern.
The Flyweight Pattern is designed to control object creation where objects in an application have great similarities and are of a similar kind, and provides you with a basic caching mechanism. It allows you to create one object per type (the type here differs by a property of that object), and if you ask for an object with the same property (already created), it will return you the same object instead of creating a new one.
Via a real life example, you will learn how and when the Flyweight design pattern should be used and how to structure your code in order to implement it. You will see how it can lead to elegant solutions to code problems.