Enhancing Testability and Maintainability through SOLID Principle

In this lesson, we will review a design approach known as the hexagonal architecture, based on the SOLID principles we already know. Using this approach allows us to use TDD more effectively across more of our code base.

Implementing SOLID principles

We learned that the Dependency Inversion Principle helps us isolate some code we wanted to test from the details of its collaborators. We noted that was useful for testing things that connected to external systems that were outside of our control. We saw how the single responsibility principle guided us into splitting up software into smaller, more focused tasks.

Applying these ideas to our earlier sales reporting example, we would arrive at an improved design, as shown in the following diagram:

Get hands-on with 1200+ tech skills courses.