In computer programming, the flyweightsoftware design pattern refers to an object that minimizes memory usage by sharing some of its data with other similar objects. The flyweight pattern is one of twenty-three well-known GoF design patterns.[1] 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[2] to efficiently handle glyph information in a WYSIWYG document editor.[3] Similar techniques were already used in other systems, however, as early as 1988.[4]
^
Calder, Paul R.; Linton, Mark A. (October 1990). "Glyphs: Flyweight Objects for User Interfaces". Proceedings of the 3rd annual ACM SIGGRAPH symposium on User interface software and technology - UIST '90. The 3rd Annual ACM SIGGRAPH Symposium on User Interface Software and Technology. Snowbird, Utah, United States. pp. 92–101. doi:10.1145/97924.97935. ISBN0-89791-410-4.
^
Weinand, Andre; Gamma, Erich; Marty, Rudolf (1988). ET++—an object oriented application framework in C++. OOPSLA (Object-Oriented Programming Systems, Languages and Applications). San Diego, California, United States. pp. 46–57. CiteSeerX10.1.1.471.8796. doi:10.1145/62083.62089. ISBN0-89791-284-5.