Skip to content

Architecture & Patterns

Synthesis of the previous four sections. Layered/clean/hexagonal architecture, DDD tactical patterns, CQRS + MediatR, the repository/unit-of-work debate (when EF's DbContext already IS your UoW), the result-pattern-vs-exceptions debate, vertical slice architecture, and pragmatic SOLID.

The sidebar under this section is grouped into Patterns Fundamentals (GoF, SOLID, Result vs exceptions, object-mapping libraries — the OO and toolchain primitives) and Architectural Styles (the opinionated, application-shape choices: Clean / Onion / Hex, DDD, CQRS, VSA, Repository).

Topics (canonical order)

Why this order

Big-picture architectures (Clean / Onion / Hexagonal) come first because they frame everything. DDD comes next because it's the dominant tactical vocabulary. CQRS+MediatR follows because it operationalizes DDD and intersects with EF Core. The Repo/UoW debate and Result/exceptions debate come after because they're informed by EF Core mechanics. VSA closes the structural conversation. SOLID is intentionally last because over-application of SOLID is itself an anti-pattern; the senior view is "use it as a sanity check, not a religion."

Cross-references