Abstract
The Flyweight pattern allows a large number of similar objects to be reduced in number to a small set of shared objects. This has benefits in terms of memory overheads, object creation, object destruction etc. However, the state of the shared objects may need to be analysed to determine which parts of the state can be shared (and permanently stored internally to the object) and which parts of the state need to be externalized and provided by a client of the shared object each time it accesses that object.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Hunt, J. (2013). Flyweight. In: Scala Design Patterns. Springer, Cham. https://doi.org/10.1007/978-3-319-02192-8_24
Download citation
DOI: https://doi.org/10.1007/978-3-319-02192-8_24
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-02191-1
Online ISBN: 978-3-319-02192-8
eBook Packages: Computer ScienceComputer Science (R0)