Scala Design Patterns.
上QQ阅读APP看书,第一时间看更新

The flyweight design pattern

The flyweight design pattern provides an object that is used to minimize memory usage by sharing it throughout the application. This object should contain as much data as possible. A common example given is a word processor, where each character's graphical representation is shared with the other same characters. The local information then is only the position of the character, which is stored internally.