Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Flyweight pattern
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Software design pattern for objects}} {{more footnotes|date=May 2008}} [[File:Linux-Mint-20-MATE-writer.png|alt=A screenshot of LibreOffice's Writer package.|thumb|Text editors, such as [[LibreOffice Writer]], often use the flyweight pattern.]] In [[computer programming]], the '''flyweight''' [[software design pattern]] refers to an [[Object (computer science)|object]] that minimizes [[Computer memory|memory]] usage by sharing some of its data with other similar objects. The flyweight pattern is one of twenty-three well-known ''[[Design Patterns|GoF design patterns]]''.<ref name="GoF">{{cite book|author=Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides|url=https://archive.org/details/designpatternsel00gamm/page/195|title=Design Patterns: Elements of Reusable Object-Oriented Software|publisher=Addison Wesley|year=1994|isbn=978-0-201-63361-0|pages=[https://archive.org/details/designpatternsel00gamm/page/195 195ff]}}</ref> These patterns promote flexible object-oriented software design, which is easier to implement, change, test, and reuse. In other contexts, the idea of sharing data structures is called [[hash consing]]. The term was first coined, and the idea extensively explored, by [[Paul Calder]] and [[Mark Linton]] in 1990<ref>{{cite book|last=Gamma|first=Erich|title=Design Patterns: Elements of Reusable Object-Oriented Software|title-link=Design Patterns (book)|author2=Richard Helm|author3=Ralph Johnson|author4=John Vlissides|publisher=[[Addison-Wesley]]|year=1995|isbn=978-0-201-63361-0|pages=[https://archive.org/details/designpatternsel00gamm/page/205 205β206]|author-link=Erich Gamma|author2-link=Richard Helm|author3-link=Ralph Johnson (computer scientist)|author4-link=John Vlissides}} </ref> to efficiently handle glyph information in a [[WYSIWYG|WYSIWYG document editor]].<ref> {{cite conference|last1=Calder|first1=Paul R.|last2=Linton|first2=Mark A.|title=Proceedings of the 3rd annual ACM SIGGRAPH symposium on User interface software and technology - UIST '90 |date=October 1990|chapter=Glyphs: Flyweight Objects for User Interfaces|conference=The 3rd Annual [[ACM SIGGRAPH]] Symposium on User Interface Software and Technology|location=Snowbird, Utah, United States|pages=92β101|doi=10.1145/97924.97935|isbn=0-89791-410-4}} </ref> Similar techniques were already used in other systems, however, as early as 1988.<ref> {{cite conference|last1=Weinand|first1=Andre|last2=Gamma|first2=Erich|last3=Marty|first3=Rudolf|year=1988|title=ET++βan object oriented application framework in C++|conference=[[OOPSLA]] (Object-Oriented Programming Systems, Languages and Applications)|location=San Diego, California, United States|pages=46β57|citeseerx=10.1.1.471.8796|doi=10.1145/62083.62089|isbn=0-89791-284-5}} </ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)