Clean Architecture

I dont feel Clean Architecture is a one size fits all solution, each project I’ve worked on had different needs/fits. I think its about understanding the benifits of each approach and adopting what works for your problem domain. Web Application Architecture or the DDD Oriented Microservice examples will all work as long as the team communicate and stick to the decided architecture.

Clean Architecture

This has been known by a few names over the years: Hexagonal Architecture, Ports-and-Adapters and Onion Architecture. Its all really the same thing.

“Clean architecture puts the business logic and application model at the center of the application. Instead of having business logic depend on data access or other infrastructure concerns, this dependency is inverted: infrastructure and implementation details depend on the Application Core. This is achieved by defining abstractions, or interfaces, in the Application Core, which are then implemented by types defined in the Infrastructure layer.”

Example: Ardalis

Application architecture of the ardalis/CleanArchitecture example application that follows clean architecture and Domain Driven Design.

ardalis/CleanArchitecture

Example: Jason Taylor

Jason describes this with the domain layer first however it makes more sense to me to have the UI first, this also makes it simpler for me to draw similarities with other examples.

Jason Taylor/CleanArchitecture

Building on these

Other common things these projects house:

  • Infrastructure
1
Feature.FeatureStrategies                 ~ abstract factory based on `IFeatureStrategy` for AB toggle 

References