Chapter 4: Getting Familiar with Behavioral Patterns
This chapter discusses behavioral patterns in terms of Kotlin. Behavioral patterns deal with how objects interact with one another.
We'll learn how an object can alter its behavior based on the situation, how objects can communicate without knowledge of one another, and how to iterate over complex structures easily. We'll also touch on the concept of functional programming in Kotlin, which will help us implement some of these patterns easily.
In this chapter, we will cover the following topics:
- Strategy
- Iterator
- State
- Command
- Chain of Responsibility
- Interpreter
- Mediator
- Memento
- Visitor
- Template method
- Observer
By the end of this chapter, you'll be able to structure your code in a highly decoupled and flexible manner.