Sitemap
Emanuele Longo

Emanuele Longo

.NET Software Developer driven by clean architecture and purposeful design.

Member-only story

Domain Logic in .NET C#: From Transaction Scripts to rich Domain Models (2026)

17 min readOct 25, 2026

Imagine your e-commerce has been running for a year. The coupon BENVENUTO10 started as one line in the order endpoint. Today marketing wants a second rule: the coupon is not valid on products already on sale. You open the code and discover that the discount is computed in three places: the checkout, the admin panel that recalculates the total when support edits an order, and the nightly import. (If you want to find out more about how the order code ended up in a layered solution, click here.)

Nobody made a mistake. Each copy was reasonable on the day it was written. The problem is a question we never answered: where do the business rules live, and what shape do they take?

This is exactly the kind of problem the domain logic patterns were born to solve: three ways of organizing the rules of an application, from one procedure per use case to a network of objects that protect their own rules.

But as often happens in the world of software, the most famous of the three is also the most misused. Let’s see why.

Press enter or click to view image in full size
Domain Logic cover in the style of the Modern Software Architecture series: the aggregate boundary around the title on a blueprint
Domain Logic .NET C#

The Origins: Three answers to one question

In 2002 Martin Fowler published Patterns of Enterprise Application Architecture, and in it he named three ways to organize the logic of the…

--

--

Emanuele Longo
Emanuele Longo

Written by Emanuele Longo

.NET Software Developer driven by clean architecture and purposeful design.