We have seen in Chapter 12, The State pattern, which helps us in making behavior changes when an object's internal state changes, by using state machines. There is a number of behavioral patterns and, in this chapter, we are going to discuss five more of them: Interpreter, Strategy, Memento, Iterator, and Template.
What is the Interpreter pattern? The Interpreter pattern is interesting for the advanced users of an application. The main idea behind this pattern is to give the ability to non-beginner users and domain experts to use a simple language, to get more productive in doing what they need to with the application.
What is the Strategy pattern? The Strategy pattern promotes using multiple algorithms to solve a problem. For example, if you have two algorithms to solve a problem with some difference in performance depending on the input data, you...