Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
2 user(s) are online (2 user(s) are browsing encyclopedia)

Members: 0
Guests: 2

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Flyweight pattern

Flyweight is a software design pattern (computer science). 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, a large document with this data structure would bloat the memory footprint of the word processor. Moreover, since much of this data is repeated, there must be a way to reduce the footprint - the Flyweight pattern. 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=

*[http://xmlpatterns.com/FlyweightMain.shtml XML Flyweight Design Pattern] *Article [http://www.javaworld.com/javaworld/jw-07-2003/jw-0725-designpatterns.html Make your apps fly - Implement Flyweight to improve performance] by David Geary *Article [http://theserverside.com/articles/article.tssl=Caching Enhancing Web Application Performance with Caching] by Neal Ford *Article [http://codeproject.com/gen/design/testvalidators.asp The Flyweight Pattern] by Alberto Bar-Noy *Sample Chapter [http://awprofessional.com/articles/article.aspp=31563 C# Design Patterns: The Flyweight Pattern] by James W. Cooper *Section [http://btl.usc.edu/rides/documentn/refMan/rf21_d.html Flyweight Text Entry Fields] from the RIDES Reference Manual by Allen Munro and Quentin A. Pizzini *[http://c2.com/cgi/wikiFlyweightPattern Description] from Portland s Pattern Repository *[http://dofactory.com/Patterns/PatternFlyweight.aspx Overview] *[http://sourdough.phpee.com/index.phpnode=18 Sourdough Design] *[http://finucane.de/flyweigh.htm Use sharing to support large numbers of fine grained objects efficiently] *[http://www.allapplabs.com/java_design_patterns/flyweight_pattern.htm Structural Patterns - Flyweight Pattern] *[http://perlmonks.thepen.com/94783.html Class::Flyweight - implement the flyweight pattern in OO perl] *[http://www.ragingsmurf.com/code.aspxkey=I7U64DMGWM ASP.NET Code Sample] *[http://citeseer.ist.psu.edu/cisq=flyweight+pattern Citations] from CiteSeer