Flyweight Pattern

Flyweight is a software design pattern. When many objects must be manipulated and these cannot afford to have extraneous data, flyweight is appropriate. In the flyweight pattern, the data has no pointers to the data type methods, because these would consume too much space. Instead, the subroutines are called directly. In some cases, flyweight inheritance is performed by "shift-in" and "shift-out" data markers as a higher-level operation cycles through an array of flyweight data. One classic example of a flyweight pattern are the characters stored in a word processor. Each character represents an object that has a font face, font size, and other formatting data. As you can imagine, having a large document with this data structure would be very impactful on the memory footprint of the word processor. Moreover, since much of this data is repeated, there must be a way to reduce the footprint - and with the Flyweight pattern, there is! Each of the character objects would contain a reference to a separate formatting object which contains the required properties. This greatly reduces the memory footprint by combining all of the like-formatted characters into simpler objects that reference a single formatting object. There is also a version of this pattern for working with XML structures.

External links

 

<< PreviousWord BrowserNext >>
kavadh ii of persia
penny
khosrau ii of persia
hormizd i of persia
hormizd ii of persia
hormizd iii of persia
hormizd iv of persia
hormizd vi of persia
peroz i of persia
gourd
edgeplay
woolsthorpe manor
ageplay
linux framebuffer
siege of plzen
edinburgh academy
william king (poet)
achaians
maria goeppert mayer
enciclopedia libre
motorola cpu32
liberal unionist party
list of capitals of subnational entities
andy white
battle of narva
let it be
legal instruments of jehovah's witnesses
memento pattern
abbey road
charles montagu, 1st earl of halifax
geoff emerick
naphtali daggett
lien chan
isotropic antenna
al hakim mosque
legislative yuan
fiber
national assembly
marx
b specification language
atoll programming language
access query language
bs2000
siemens nixdorf informationssysteme