Abstract
The observer pattern provides a way of ensuring that a set of objects is notified whenever the state of another object changes. It has been widely used in a number of languages (such as Smalltalk and Java) and can also be used with Scala. However, numerous commentators have dismissed the Observer pattern in favour of other patterns such as the Mediator pattern as the communication involved is more obvious and easier to following, maintain and debug. This does not mean that the Observer pattern is without merit and there are situations in which it can be used successfully; it is therefore useful to be aware of this pattern and how it might be realised in Scala.
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). Observer. In: Scala Design Patterns. Springer, Cham. https://doi.org/10.1007/978-3-319-02192-8_32
Download citation
DOI: https://doi.org/10.1007/978-3-319-02192-8_32
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)