Stack Explorer

Onion Architecture

Application

Onion-shaped layers with the domain at the center

Principles

Domain Model at the centerDomain Services in middle layerApplication Services on the outsideInfrastructure at the edge

When to use

Enterprise applications, complex domains, when testability is a priority

When not to use

Small applications, MVPs, simple CRUD

Pros and Cons

Ventajas

  • + Completely isolated domain
  • + High testability
  • + Infrastructure independence
  • + Easy to maintain

Desventajas

  • - Initial complexity
  • - Lots of boilerplate
  • - Learning curve

Related Technologies