The group of behavioral design patterns is a relatively big one. In the previous chapter, we looked at the first part of behavioral design patterns and understood what their purpose is. As we already know, these patterns are used to deal with behavior and modeling object communication in computer programs.
In this chapter, we will continue going through the different behavioral design patterns as seen from the point of view of Scala. We will look at the following topics:
Iterator
Mediator
Memento
Observer
State
Template method
Visitor
The design patterns that we will cover in this chapter might not be as relevant to functional programming as some of the others we've seen earlier. They might look like Scala implementations of Java design patterns and this will actually be the case. However, this does not make them unnecessary and they are still important due to the hybrid nature of Scala.
As in the previous chapters, we will follow the same structure—give...