Skip to main content

Observer

  • Chapter
  • First Online:
Scala Design Patterns
  • 2943 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics