Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
The Application Layer and Use Cases: Handlers, Validation, and Transaction Boundaries Without MediatR
In the Application layer each use case is a single-purpose handler class: input validation stays in Web, business rules stay in the Domain, expected failures come back as a Result, and a single SaveChanges draws the transaction boundary. Adding cross-cutting concerns with Scrutor decorators instead of MediatR, and MediatR's licensing after 13.0.0.
Clean Architecture: The Dependency Rule, Use Cases, and Data Crossing Boundaries
Clean Architecture (Martin, 2012) has one rule, the Dependency Rule: source code dependencies point only inward, and what crosses a boundary is a simple data structure shaped for the inner circle, not an entity or a database row. In Bookstore: the four circles, the JSON cycle error caused by returning an EF Core row, the output port and presenter versus the pragmatic ASP.NET Core counterpart of a handler returning a Result, and a comparison of Hexagonal, Onion and Clean.
Use Case Diagrams and Specifications: Actors, include, extend and the Cockburn Template
A use case diagram shows the system from outside: actors are roles, use cases are goals; the include arrow goes from the base to a mandatory step, the extend arrow from a conditional addition to the base. The HR Portal leave module's use case diagram, the Request Leave specification in Cockburn's fully dressed template, mapping use cases to user stories and API endpoints, and the same diagram in Mermaid.