← BYTES
Design Patterns·Starter·Ref: 17.1.15

What is the Flyweight pattern primarily used to reduce?

Have a question about this video? Mention reference 17.1.15 when you contact us.

a.The number of lines of code in a program
b.Memory usage, by sharing one physical object representing common, unchanging ('intrinsic') data across many logical instances, instead of duplicating that data in every instance
c.The time it takes to compile a program
d.The number of unit tests needed for a class
Flyweight shares expensive, repeated, unchanging data across many logical 'instances' via one physical shared object (e.g., a text editor sharing one glyph object per character shape, rather than one full object per character on screen), each caller supplying its own small, specific ('extrinsic') data separately -- dramatically cutting memory use when many near-identical objects would otherwise be needed.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES17115#DesignPatterns