Getting Familiar with Behavioral Patterns
This chapter talks about behavioral patterns using Kotlin. Behavioral patterns deal with how things interact with each other.
We will learn how an object can change how it acts depending on the situation, how objects can talk to each other without knowing all the details, and how to go through complicated setups easily. We will also touch on functional programming in Kotlin, which makes it easier to use some of these patterns.
In this chapter, we’ll explore 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. From enabling dynamic changes in behavior to streamlining communication between objects, these patterns empower developers to craft resilient...