Design Patterns · Junior · Question 24 of 75

Why do you need the Flyweight pattern?

Explanation

If 100,000 objects share a lot of identical data (an icon, a style, a type description), the shared part is stored once, and objects keep only their unique fields. JS strings and primitives partly use a similar technique.

Further reading

Problem with a question

Design Patterns · Junior · question 24

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz