Skip to content

Architecture Styles

Rickard Fransén edited this page Aug 15, 2020 · 6 revisions

Manga uses ideas from popular architectural styles. The Ports and Adapters are the simplest one followed by the others, they complement each other and aim a software made by use cases decoupled from technology implementation details.

Hexagonal Architecture Style

The general idea behind Hexagonal architecture style is that the dependencies (Adapters) required by the software to run are used behind an interface (Port).

The software is divided into Application and Infrastructure in which the adapters are interchangeable components developed and tested in isolation. The Application is loosely coupled to the Adapters and their implementation details.

Ports

Interfaces like ICustomerRepository, IOutputPort and IUnitOfWork are ports required by the application.

Adapters

The interface implementations, they are specific to a technology and bring external capabilities. For instance the CustomerRepository inside the EntityFrameworkDataAccess folder provides capabilities to consume an SQL Server database.

Ports and Adapters

The Left Side

Primary Actors are usually the user interface or the Test Suit.

The Right Side

The Secondary Actors are usually Databases, Cloud Services or other systems.

Onion Architecture Style

Very similar to Ports and Adapters, I would add that data objects cross boundaries as simple data structures. For instance, when the controller execute a use case it passes an immutable Input message. When the use cases calls a Presenter it gives an Output message (Data Transfer Objects if you like).

Clean Architecture Style

The Clean Architecture style focus on a loosely coupled implementation of use cases and it is summarized as:

  1. It is an architecture style that the Use Cases are the central organizing structure.
  2. Follows the Ports and Adapters pattern.
    • The implementation is guided by tests (TDD Outside-In).
    • Decoupled from technology details.
  3. Follows lots of principles (Stable Abstractions Principle, Stable Dependencies Principle, SOLID and so on).
Clone this wiki locally