28

I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#.

Are there any good examples of projects practicing DDD in the open source world?

David Hall
  • 32,624
  • 10
  • 90
  • 127
Mikael Sundberg
  • 4,607
  • 4
  • 32
  • 36

12 Answers12

16

Eric Evans and a Swedish consulting company have released a sample application based on the shipping example that Eric uses throughout the book. It's in Java, but the concepts are well documented on the project page.

http://dddsample.sourceforge.net/

However, be warned that DDD is more about the journey than the destination. Understand that the sample code you are looking took many forms before it became what you see now. You did not see the awkward models that were used initially and you're missing the steps taken to refactor the model based on insight gained along the way. While the building blocks are important in DDD, Eric belives they are over-emphasized, so take all samples with a grain of salt.

Stefan Moser
  • 6,663
  • 9
  • 35
  • 48
  • The sample has been ported to C#. See Lance Fisher's answers for the link. – Stefan Moser Oct 07 '10 at 21:57
  • 2
    +1 @stefan is right on the money, ddd is not about the building block patterns, its not about using framework x over framework y. its about constantly asking is this model helping me solve the core problems in my domain. models are not universal representations of "truth" or "reality", they exist to solve a specific problem. get that right and dont fret about the rest, its all just details. – Kyri Sarantakos Apr 02 '11 at 07:34
  • I believe this project died as well. It's a shame because it has been the one i like the most. Very simple, straight, concise, although it has some violations of the book (like referencing a value object in one aggregate, to another value object in a different aggregate), it's overall an excellent guide. – Pepito Fernandez Nov 17 '12 at 15:40
10

I'm not sure how complete it is, but I found the NDDD Sample on Google Code.

Lance Fisher
  • 25,684
  • 22
  • 96
  • 122
  • I believe this project died as well. It's a shame because it has been the one i like the most. Very simple, straight, concise, although it has some violations of the book (like referencing a value object in one aggregate, to another value object in a different aggregate), it's overall an excellent guide. – Pepito Fernandez Nov 17 '12 at 15:40
5

I'm surprised no one mentioned Macto, Ayende's DDD sample. The most important thing about Macto is that the hole thinking process before the actual coding is presented in a series of posts. DDD is not about implementing a model, is about modeling a business domain. Decisions like "some concept is an Aggregate Root/Entity/Value Object" are far more important than how will an AR be persisted.

Also i would recommend Udi Dahan's videos about SOA and CQRS which might provide a better context on which to apply DDD.

Iulian Margarintescu
  • 2,656
  • 21
  • 22
  • Macto is incomplete. He never finished it. He boasted about it, after a series of blogs (very destructive critic) about NLayerApp from Microsoft Spain... but at the end of the day he came off short. He said he was too busy, which i don't doubt, the guy is really good at what he does, and his arrogance (a**holeness) is equally proportional. – Pepito Fernandez Nov 17 '12 at 15:36
4

This is not an open source project, but still it is an example in code: http://www.codeplex.com/dddpds

The example is used in the book .NET Domain-Driven Design with C#: Problem-Design-Solution


A made-up example that seems promising but might have died: http://www.codeplex.com/domaindrivendesign

Carl Björknäs
  • 593
  • 4
  • 15
2

I'm afraid that http://www.codeplex.com/domaindrivendesign has indeed died, but if anyone is interested in contributing feel free to contact me.

Overall I would recommend against relying too much on examples of DDD, at best examples can show the results of the domain modelling and/or one approach for implementing the patterns. I would thus recommend reading the book and then asking questions at the forum.

Colin Jack
  • 756
  • 4
  • 8
2

http://kigg.codeplex.com/ is a good example for me.

Sasapet
  • 41
  • 2
1

A good read is Jimmi Nilssons book (and blog for that matter) Applying domain driven design

It's a mixture of Evans and Fowlers books (Domain-Driven Design - Evans), and (Patterns of Enterprise Application Architecture - Fowler)

Paul Rayner
  • 529
  • 4
  • 7
kitofr
  • 751
  • 1
  • 7
  • 11
1

I know it is not C#, but this is a java meta-framework that follows a domain driven approach: I don't know much about it but I'm willing to study it in the near future: Roma Framework

mox601
  • 422
  • 2
  • 7
  • 23
1

http://sellandbuy.codeplex.com/

another project DDD

Mohamed Abed
  • 5,025
  • 22
  • 31
0

I haven't used any myself, but there are some tools mentioned on the DDD Wikipedia page. Most of them seem to be implemented in Java though.

http://en.wikipedia.org/wiki/Domain-driven_design#Software_tools_to_support_domain-driven_design

Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
0

Code Camp Server, Jeffrey Palermo's sample code for the book ASP.NET MVC in Action is open source and uses DDD.

(Same as my answer in Good Domain Driven Design samples)

Community
  • 1
  • 1
Peter Tate
  • 2,178
  • 1
  • 21
  • 32
0

Ok, I found this, but it's Java not C#:
http://timeandmoney.domainlanguage.com/

Mikael Sundberg
  • 4,607
  • 4
  • 32
  • 36