Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
6 posts found
What Is Vertical Slice Architecture? Organizing Code by Feature, Not by Layer
Software Architecture PART 01

What Is Vertical Slice Architecture? Organizing Code by Feature, Not by Layer

Vertical Slice Architecture slices code by what each request needs end to end rather than by technical layer, so coupling drops between slices and rises inside them. With real git output we watch the same two features conflict in five files in a layered Bookstore and in one file in a sliced one, then look at a slice's anatomy and three common misreadings.

7 Nov 2026 10 min 4
Your First Slice Without MediatR: Minimal API, a Handler Class, and Endpoint Registration
Software Architecture PART 02

Your First Slice Without MediatR: Minimal API, a Handler Class, and Endpoint Registration

A slice without MediatR is built from request and response records, a handler class that uses DbContext directly, and an IEndpoint that maps its own route, with an assembly scan doing the registration. We write Bookstore's PlaceOrder and GetOrderDetails slices with .NET 10 AddValidation, TypedResults, and EF Core projections, and show how a naming convention can take down every endpoint and how to catch that at startup.

7 Nov 2026 13 min 5
Slices with a Mediator: Comparing MediatR, Source-Generated Mediator, and Wolverine
Software Architecture PART 03

Slices with a Mediator: Comparing MediatR, Source-Generated Mediator, and Wolverine

The real gain of a mediator in slices is a pipeline that is independent of the entry point; as of November 2026 MediatR 14.3 is RPL 1.5 or commercially licensed, while Mediator 3.0.2 and Wolverine 6.62 are MIT. We write the same PlaceOrder slice with all three tools and with a mediator-free endpoint filter, and compare dispatch cost, first-request time, Native AOT behaviour, and each tool's real setup pitfalls.

7 Nov 2026 15 min 4
Sharing Across Slices: Duplication or Abstraction, and Where Does Domain Logic Go?
Software Architecture PART 04

Sharing Across Slices: Duplication or Abstraction, and Where Does Domain Logic Go?

Across slices you share the domain model, cross-cutting concerns, and infrastructure; you don't share request/response types, queries, or workflows, and invariants move into the entity without waiting for a second copy. With real output we see a rule placed on a request allow a 7-copy order and a slice calling another slice save an order whose payment was declined, then prevent that with an ArchUnitNET slice test.

7 Nov 2026 11 min 4
Testing Vertical Slices: Integration Tests per Slice and Unit Tests Where They Matter
Software Architecture PART 05

Testing Vertical Slices: Integration Tests per Slice and Unit Tests Where They Matter

A slice's natural test unit is the path from the HTTP request to the real database, while domain rules are tested cheaply with pure unit tests. We build per-slice tests with WebApplicationFactory, a real SQL Server via Testcontainers, and Respawn, and show with real output how tests break each other without a reset and how the InMemory provider both passes and fails wrongly on the same search query.

7 Nov 2026 11 min 3
When to Use Vertical Slices: Combining Them with Clean Architecture and Modular Monoliths
Software Architecture PART 06

When to Use Vertical Slices: Combining Them with Clean Architecture and Modular Monoliths

Vertical slices work well for APIs that gain features often and whose use cases vary in complexity; they aren't enough on their own for teams without refactoring discipline or for rich, shared domains, and they work best together with a Clean domain core and modular monolith boundaries. We split Bookstore into modules and protect the boundary with internal and ArchUnitNET, evaluate REPR with FastEndpoints, and lay out a plan for moving a layered project to slices gradually.

7 Nov 2026 11 min 4
Blog Map