Modular and Layered Architectures
The previous chapters have repeatedly mentioned the importance of appropriate modularization of the system and addressing concerns separately. In this chapter, we delve into four prominent architectural patterns that offer their approaches to separate concerns in layers, modularize code, and set up clean boundaries among modules.
All these patterns will be illustrated with the same real-life example to highlight the similarities and differences of these patterns.
By understanding these patterns with code examples in Kotlin, engineers can make informed choices to create loosely coupling and highly cohesive modules that are testable, flexible, and maintainable.
The following architectural patterns will be covered:
- Clean Architecture
- The hexagonal architecture
- Functional core, imperative shell (FCIS)
- The Connect pattern
At the end, these patterns will be briefly compared with one another. We will also explore the possibility...