The flyweight structural pattern allows you to represent more items in your application as class instances without using up all your computer memory.
It does this with four steps:
This pattern shows you how to save a lot of memory when dealing with many instances of your classes. It’s likely to allow you to represent items as class instances that you wouldn’t have been able to consider before.