Skip to content

Application architecture

Targets net10.0 csharp-14Last reviewed 2026-09-14 freshSources code-with-mukesh derek-comartin mark-seemann milan-jovanovic ms-learn

Start with a modular monolith. Build each module from vertical slices, and add layered (Clean) architecture only where domain rules need the dependency boundaries.

Opinions

  • Default to a modular monolith, not microservices. Modules set the large boundaries: business ownership, data ownership, communication, and public APIs. Decide those early. A process boundary is a deployment choice you can add later, when a module needs one. (Jovanović: Modular monolith architecture in .NET)
  • Build each module from vertical slices. One use case owns its endpoint, request, validation, business logic, and data access. A feature then changes in one place, not across a controller, a service, and a repository that exist only to separate technologies. (Jovanović: Vertical slice architecture in .NET)
  • Don't treat a slice as a module. A slice organises behaviour inside a boundary, and a module defines the boundary. A slice used as a module gives you folders without a module's ownership rules. (Jovanović: Where vertical slices fit inside the modular monolith)
  • Apply Clean Architecture per slice, not per solution. Layers control dependency direction. Pay for them where domain rules must stay independent of infrastructure, and skip them in a slice that reads a row and returns it. With the same layers in every slice, a one-field change touches the schema, the persistence type, the domain type, the view model, and the mappings between them. Seemann uses that cost to argue against layering a CRUD application at all. (Jovanović: Vertical slice architecture in .NET, Mukesh: Clean Architecture in .NET 10, Seemann: Is Layering Worth the Mapping?)
  • Make a module boundary visible to the compiler. A call across a boundary that looks like a local method call is easy to make by accident. WCF invited round trips that way. Make the call async: every caller up the stack then has to handle the Task, and no helper method can hide the crossing. (Seemann: Boundaries are Explicit)
  • Publish integration events between modules, and keep domain events inside the module that raised them. A domain event dispatches in-process within one model. An integration event crosses the boundary asynchronously. Publishing a domain event couples consumers to the module's internal model as tightly as publishing its schema would.

    • Translate an internal sequence into one business fact. Publish OrderDispatched, not the TruckReserved and CarrierAssigned steps behind it.
    • Name an event for its business meaning. TruckOrderNotUsed and a generic cancellation can mean different things downstream.

    (Microsoft Learn: Domain events: design and implementation, 2018 content last reviewed 2024-01-03; Comartin: Domain Events Are NOT Your Public API, sponsored by NServiceBus in its body)

  • Name folders after features, not patterns. Use Orders/Cancel/, not Controllers/, Services/, and Repositories/. project-structure.md covers layout down to the project. Inside a project, features are the top-level folders.

Source redundancy

milan-jovanovic, with a recorded conflict of interest, and code-with-mukesh, marked Corroborate., seeded this file. Both sell templates and courses built on these patterns. mark-seemann and ms-learn support the same claims, unmarked and with nothing to sell on this topic. derek-comartin is marked Corroborate., and NServiceBus sponsors the cited article, so the events bullet cites Microsoft Learn first and flags the sponsorship beside the link.

Treat anything more specific than these opinions as unsourced, such as prescribed folder names, mediator libraries, and project counts per slice.