Enterprise Application Architecture with .NET Core
by Ganesan Senthilvel, Ovais Mehboob Ahmed Khan, Habib Qureshi
Flyweight pattern
The flyweight pattern enables the sharing of information in a resource-efficient way. You use it when you typically have the same information segment in a large number of objects and you decide to share this information between all of these large number of objects instead of having the same copy of information contained inside all of them.
For example, let's say in a software application, you have a list of a million employee records for a group of companies, and several thousands of employees belong to the same company and thus have similar information for their employer. Instead of having this information repeatedly copied into all of the employee objects, we share the common information into a separate object and let ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access