Brief Overview:

|
A flyweight object is one that minimizes memory use by sharing as much data as
possible with other similar objects. It is a way to use a large number of objects
when a simple repeated representation would use up too much memory.
One example is the representation of characters in a word processor. Each character
must have a glyph (representation of the letter), a font, font metrics, and other
formatting data. To repeat all of this for each character would take hundreds or
thousands of bytes per character, but a flyweight defining the position of a
character with references to the appropriate font, etc. would take far less memory.
|