Structural patterns tell us how to put objects together. Their focus is mostly on organizing software components. They help us to maintain order in our code. That, however, is not true for each and every one of them. A case in point, for example, is the flyweight pattern.
The flyweight pattern helps us to reduce memory usage. As such, it is less and less important in modern times, where we are dealing with gigabyte memories. Sometimes, however, we will still significantly decrease memory usage by implementing it. Also, sometimes, it will help speed up the program.
This pattern works best when part of each object contains data that is also used in other objects. Instead of duplicating that data in every object, we can extract shared data into another object. We can then replace original data in an object with a pointer to the shared data. This allows multiple objects...