Implementing DDDomain models, Ports & Adapters and CQRS with C#

Albert Starreveld
VX Company
Published in
9 min readJan 10, 2020

--

The cloud is a game-changer. Instead of building big applications that are hosted on giant machines, the industry is moving away from that and is moving towards serverless architecture. Everybody is talking about microservices. More and more developers are talking about hexagonal architecture (also known as Ports and Adapters), Domain-Driven Design and Command Query Responsibility Segregation (CQRS). In the past years, I’ve spent time studying those subjects to answer a single question: How, in an ideal world, would it be possible to implement all of these three concepts in a single application?

Part 1.) Creating the DDDomain model

Any application automates processes in a given domain. An application isn’t a CQRS or a WinForms application. It’s a billing application or a cab dispatching application.

Processes and decisions are automated in the domain model. It defines the interface users can interact with, and it describes the interface of the systems it interacts with. Like third party web services, e.g.

It all starts with the domain.

A domain is about euro’s, or kilometers, not about integers and strings

A domain model emerges from being explicit about the domain. In any domain, there are quantifiable things. For example, a cab driver might talk about distance and price. But are we talking kilometers or…

--

--

Albert Starreveld
VX Company

Passionate about cloud native software development. Only by sharing knowledge and code we can take software development to the next level!