↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together

The post presents “Explicit Architecture” as a way to combine DDD, Hexagonal, Onion, Clean Architecture, and CQRS. It centers the application core, separates internal code from external tools, and keeps dependencies pointing inward so the business logic stays isolated from user interfaces and infrastructure.

Reading notes
#

  • The system is split into user interface code, the application core, and infrastructure code.
  • Ports belong inside the business logic, while adapters belong outside it.
  • Primary adapters translate delivery mechanisms into application core calls.
  • Secondary adapters implement ports and are injected where the application core needs them.
  • The application layer contains use cases, application services, command handlers, ports, and application events.
  • The domain layer contains entities, value objects, enums, domain services, and domain events.
  • Components should be organized by domain or bounded context rather than by layer.
  • Components should stay decoupled through architectural mechanisms such as events, a shared kernel, eventual consistency, or a discovery service.
  • A component may query data from another component, but it should not change data it does not own.
  • With a command bus, the controller depends on the bus and on a command or query, while handlers are configured separately.
  • The overall goal is a codebase that is loosely coupled and highly cohesive, with architecture adapted to the actual needs of the application.