Java Design Patterns: Flyweight Live Coding

Publicado el: 08 noviembre 2023
en el canal de: datmt
26
1

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


En esta página del sitio puede ver el video en línea Java Design Patterns: Flyweight Live Coding de Duración hora minuto segunda en buena calidad , que subió el usuario datmt 08 noviembre 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 26 veces y le gustó 1 a los espectadores. Disfruta viendo!