Summary
This chapter explored layered architecture and its differences from hexagonal architecture. We started by reviewing the purpose of layered architecture to provide some level of separation of concerns through logical layers containing code with specific responsibilities. After reviewing the idea of the layered approach, we dirtied our hands by implementing a simple user access application from scratch containing the API, service, and data layers. To highlight the differences between the layered and hexagonal architectures, we refactored the user access application to use the hexagonal approach. By doing so, we saw that the layered architecture does not entirely protect the application from major changes, such as those that touch on infrastructure components such as external data access handling. Finally, we assessed the advantages and disadvantages of the layered and hexagonal architectures, concluding that the layered one is a good choice when no significant project requirement...