What it is good for

As we already mentioned before, the flyweight design pattern is useful when we are trying to lower the memory used by an application. Using shared objects, our application will require less constructions and destructions of objects, which could further improve performance.

Get Scala Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.