Domain-Driven Design
Software development approach for complex needs by connecting the implementation to an evolving model.
Contents
Sample Projects
.NET (C#/F#)
Full ASP.NET Core 3.1 reference application from Microsoft showing monolithic deployment architecture
solution presents usage of DDD tactical patterns to achieve better readability and expressiveness of the code. Applying DDD patterns together with ubiquitous language closes the gap between language spoken by experts and the team and language used in the code.
Domain Driven Design, CQRS, & Event Sourcing Example using GetEventStore, CommonDomain, NServiceBus, Entity Framework, SQL Server, SignalR.
An event based Micro ERP.
ContosoUniversity on ASP.NET Core with Full .NET Framework.
Sample implementation and comparison of various approaches to building DDD applications. Useful as a baseline to quickly start a DDD .net project.
An idiomatic F# implementation of Domain-Driven Design
(C#) - a .NET skeleton project to introduce the concepts of Domain Driven Design and loosely coupled layers.
Examples of implementation CQRS with Event Sourcing - evolutionary approach (no CQRS, separate models and commands with the same model, separate models and commands with separate models, separate storage engines, event sourcing).
Email marketing ASP.NET Core MVC and ASP.NET MVC demo app demonstrating CoreDdd usage
Full ASP.NET Core 3.1 application with Clean Architecture, DDD, CQRS and Event Sourcing concepts
eShop fullstack example featuring catalog, basket, checkout, and order bounded contexts
Example of Domain Driven Design for the game of checkers. There are two files: a scratch file with a series of designs, and a final version.
samples and resources about Event Sourcing and CQRS in .NET. Contains also a self-paced kit of how to built own Event Store
DDD, CQRS, and Event-Sourcing example and contains following technology stack: EventFlow, EventStore, RabbitMQ, MongoDB, PostgreSQL, Docker
Example project that accompanies Mark Nijhof's CQRS book.
Event sourcing implementation sample in F#.
These are the sample Bounded Contexts for C#.NET from the book "Implementing Domain-Driven Design" by Vaughn Vernon.
Modular application built with Clean Architecture and DDD principles which is ready to quickly get splitted into microserves.
Sample code from CQRS Journey.
Full Modular Monolith .NET application with Domain-Driven Design approach.
Starter template for a modular application in Clean Architecture DDD style with synchronous interaction between modules within single transaction. Perfect for ERP applications.
(.Net Core Preview 2) - a N-Layered Architecture Sample Project.
Reactive Trader Cloud by Adaptive Consulting.
.NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.
CQRS without the Plumbing, video.
Greg Young's SimpleCQRS in F#.
Greg Young's "Simplest Thing" CQRS with Event Sourcing project.
Task management system based on .NET Core with DDD, CQRS and Event Sourcing Concepts.
Implementation of basic Todo app via tastejs/todomvc in C#/Typescript with eventsourcing, cqrs, and domain driven design
Sample app demonstrating the use of Cucumber + GO for a BDD testing approach. Blog post can be found here.
This is an attempt to port the DDD Sample App to idiomatic Go. It can be run in a dockerized mode for previewing the application.
Complete serverless application to show how to apply DDD, Clean Architecture, and CQRS by practical refactoring of a Go project. A full blog series about it can be found at https://threedots.tech/.
Sample DDD application implementing the 4 layers (Domain, Infrastructure, Application and Interface) and considering two domain patterns. There's a blog article written for it here.
Just another sample application implementing the four layers of DDD.
API implementation with full CRUD using a SOLID, Hexagonal Architecture. There is a series of blog post written for it at https://blog.friendsofgo.tech/.
PoC for a patients API using the hexagonal architecture pattern.
A boilerplate project for DDD in Azure using a custom handler and Cosmos DB for event sourcing
Haskell
JavaScript / TypeScript
Example applications built with Booster Framework.
Complete working example of using Domain Driven Design (DDD), Hexagonal Architecture, CQRS, Event Sourcing (ES), Event Driven Architecture (EDA), Behaviour Driven Development (BDD) using TypeScript and NestJS generated using the Bitloops Language (BL).
JVM languages
Demo project to implement the CQRS and Event Sourcing patterns in Scala-Akka.
sample project of a library driven by real business requirements. Modular monolith implemented with the help od DDD, BDD, EventStorming, Example Mapping, CQRS, and more.
DDD-CQRS sample v2.0 project that helps you with starting out advanced domain modeling using Spring, JPA and testing.
"Do It Yourself" DDD workshop and a sample DDD application at the same time. Based on a project managing domain.
A simplified (in memory) example of Event Sourcing and CQRS implementation for Java code (modeled for banking domain use cases).
A pragmatic application of Event Sourcing and CQRS in Java with good references for common related problems, e.g. event ordering and idempotency.
Sample event sourced application with Command Query Responsibility Segregation
These are the sample Bounded Contexts from the book "Implementing Domain-Driven Design" by Vaughn Vernon.
Examples of implementation CQRS with Event Sourcing - evolutionary approach (no CQRS, separate models and commands with the same model, separate models and commands with separate models, separate storage engines, event sourcing).
Sample DDD/CQRS project written in Kotlin.
A concrete sample to go through EventStorming workshop and implement DDD tactical design pattern in Java, apply AWS cloud native services to build up business Event based Coffeeshop scenario.
Sample DDD project using Spring Boot (originally hosted in http://dddsample.sourceforge.net/)
This project demonstrates how you can develop applications with the Jakarta EE platform using widely adopted architectural best practices like Domain-Driven Design (DDD). The code is intended to mirror a non-trivial application that developers in the real work would work on. It attempts to demonstrate first-hand how you can use Jakarta EE to effectively meet practical enterprise concerns such as productivity, agility, testability, flexibility, maintainability, scalability and security. The project is directly based on the well known original Java DDD sample application developed by DDD pioneer Eric Evans' company Domain Language and the Swedish software consulting company Citerus.
Simple DDD + Clean Architecture using Micronaut.
PHP
DDD CQRS ADR hexagonal architecture implementation built with PHP 7 and Symfony 5.
A DDD Onion Architecture implementation with Symfony 7 as modulith.
A sample application in PHP built with Symfony 3 and Vue.js.
Sample implementation in PHP.
PHP 7 Version of the cargo sample used in Eric Evans DDD book
Sample project that demonstrates how simple shop cart can look like. Domain objects,Doctrine integration.,TDD,layers,unit testing
DDD, CQRS and Event Sourcing app using Symfony and PHP 8.
Training Courses
Community Resources
A Discord (old Slack) team for those who want to chat about Domain-Driven Design, CQRS, Event Sourcing and sometimes random things. Main channel is language and framework agnostic.
Advanced Topics in Event Sourcing / CQRS / DDD list compiled and maintaned by @sebastianharko.
awesome list that focuses only on Event Storming.
awesome list that focuses only on Domain Storytelling.
GitHub's profile of Domain-Driven Design in dynamic languages.
Context Mapping Cheatsheet and Starter Kit by ddd-crew.
Libraries and Frameworks
GO
Ginkgo builds on Go's testing package, allowing expressive Behavior-Driven Development ("BDD") style tests.
Small BDD framework for GO.
Go testing in the browser. Integrates with go test. Write behavioral tests in Go.
Package godog is the official Cucumber BDD framework for Golang, it merges specification and test documentation into one cohesive whole, using Gherkin formatted scenarios in the format of Given, When, Then.
.NET
.NET event sourced domain driven design model via NServicebus and GetEventStore.
Lightweight infrastructure for doing eventsourcing using aggregates.
This library helps to create ValueObjects (even with collection properties) with properly implemented equality behavior.
Middleware to handling commands over HTTP; typically used in CQRS applications.
d60 event sourcing + CQRS framework.
Command Query Separation for ASP.NET Core AWS Lambda Azure Functions Google Cloud Functions ASP.NET Web API 2
Set of open-source .NET libraries helping with DDD and CQRS, with NHibernate persistence
CQRS on Windows Azure.
Async/await first CQRS+ES and DDD framework for .NET http://geteventflow.net/.
A library to facilitate communication between CommandService and QueryService. The Idea is when any event occures in commandService, it should be persisted in QueryService in MongoDb.
A set of libraries for CQRS and Event Sourcing, with a Domain-Driven Design flavor.
Postgresql as a Document Database and Event Store for .Net Applications.
Distributed Application Framework for .NET.
Supports request/response, commands, queries, notifications and events, synchronous and async with intelligent dispatching via C# generic variance.
Described in this video: The Beating Heart of CQRS, or Actor-Based Message Routing on the CLR by Paulmichael Blasucci at the New York F# .NET User Group.
A persistence library used to abstract different storage implementations when using event sourcing as storage mechanism.
Service bus for .NET.
Projac is a set of projection libraries that allow you to write projections targetting various backing stores.
An simple,elegant and useful Domain-Driven Design and CQRS framework developed using .NET Core 2.0.
.NET Stream Store library targeting SQL based implementations.
Event Store for Azure Table Storage.
Making it easier to convert strings to/from .NET types.
A simple library for creating applications based on the CQRS pattern with support for attribute routing and hosted handlers. Developed in C# targeting .NET Standard 1.0.
A simple implementation of the Repository pattern for .NET, supporting MongoDB and Entity Framework, extending the model with further utilities (caching, paging, validation, etc.).
Elixir
Command handling middleware for CQRS/ES applications, Pure Functional Data Structures for Aggregates and Process Managers, Point-to-Point message routing, and much more in Elixir (Erlang VM) - All in Actor concurrency model.
Traceable, extendable and minimalist event bus implementation for Elixir with built-in event store and event watcher based on ETS.
CQRS event store using PostgreSQL for persistence.
JavaScript / TypeScript
Open-source, 4th-generation, transpiled programming language that helps you write clean code, well-designed systems, and build high-quality software that is testable, auditable and maintainable using DDD and Hexagonal Architecture.
NodeJS web API boilerplate for DDD and Clean Architecture applications.
JVM
Reusable artifacts for building applications on top of the Akka platform following CQRS/DDDD-based approach.
A lightweight flexible development framework for complex business architecture based on DDD.
Event sourced aggregates for Java.
A Modern Reactive CQRS Architecture Microservice development framework based on DDD and EventSourcing.
PHP
Python
Mature, stable Python library for event sourcing and DDD. Supports wide variety of databases, different kinds of orderings of domain events, application level encryption, snapshotting, optimistic concurrency control, and process events. Applications, and entire systems of applications, can be defined independently of infrastructure, and run in different ways (single threaded, multi-threaded, clocked, stepping, multi-process, actor model) and with different infrastructure.
Quickly create DDD Python patterns, Event-Based Systems, CRUD applications. Set of Python patterns for database access that support SQLAlchemy, MongoDB, Redis, or Pure Python. PyAssimilator allows you to write code without dependencies, meaning you can switch SQL to NoSQL without changing a single file in your system.