Instead of forcing your application into a prescriptive template like Clean or Hexagonal Architectures, get back to basics and use patterns from Modular Software Design. Divide the application into independent modules, each containing business logic representing a specific process. For modules with complex business logic, extract the infrastructure-related code into separate Infrastructure-Modules. This will enable you to build an application characterized by low cognitive load, high maintainability, and high extensibility.
This approach is called MIM AA (Module Infrastructure-Module Application Architecture).
Important remark: if you’re new to Modular Software Design, I really encourage you to first read the appendix on fundamentals: 8. Appendix - Introduction to Modular Design.
Why MIM AA?¶
In this article, I’d like to present a generic application architecture that can be used in a wide range of software types, whether it’s an enterprise system or a console app. It’s the result of my research on modernizing Modular Software Design with the essence of Clean/Hex/Onion Architectures.
The approach presented here isn’t revolutionary, nor did I invent it. Preparing this paper was more about connecting the dots, polishing patterns, and providing a practical example of how it can be used. Sadly, this design is relatively unknown (especially when compared to the alternatives), and what’s worse, it seems nameless. So I decided to call it a “Module Infrastructure-Module Application Architecture” or just MIM for short.
The beauty of this architecture is that it’s a natural consequence of Modular Design patterns:
High Cohesion,
Low Coupling,
Information Hiding.
... continue reading