Java Design Patterns: Flyweight Live Coding.
The Flyweight pattern is a structural design pattern that aims to minimize the use of memory
by sharing as much as possible with similar objects.
It's especially useful when a large number of objects with identical or similar data are to be used.
The pattern involves factoring the state of the object into two parts:
👉 Intrinsic state:
This is the data which is shared across the objects, does not change, and is stored in the flyweight.
👉 Extrinsic state:
This is the data that can vary per object and is not stored in the flyweight but passed
by the client code when it needs an object.
Consider a document editor that can handle different fonts.
Instead of creating an object for every character in every font and size (which would be a massive waste of memory),
we could use the Flyweight pattern
On this page of the site you can watch the video online Java Design Patterns: Flyweight Live Coding with a duration of hours minute second in good quality, which was uploaded by the user datmt 08 November 2023, share the link with friends and acquaintances, this video has already been watched 26 times on youtube and it was liked by 1 viewers. Enjoy your viewing!