Where do I find some good examples for DDD? [closed]
Asked Answered
A

7

428

I'm learning about Domain Driven Design, however there are some practical issues that are confusing to me that I think seeing some good samples might clear up.

Does anyone know of some good working code samples that do a good job of modelling basic DDD concepts?

Particularly interested in

  • An illustrative Domain Model
  • Repositories
  • Use of Domain/Application Services
  • Value Objects
  • Aggregate Roots
Allottee answered 12/2, 2009 at 5:12 Comment(6)
IHMO such debates will help a lot. Sometimes more than a simple question. E.g. we could change this in a question: "Where do i find some good examples for DDD?" and it works with the Q&A format.Enyo
i have found the "agile management project" example from Vaughn Vernon's book very instructive. it illustrates practical implementation of the building blocks you enumerate, as well as dealing with different bounded contexts, you can find the code here: github.com/VaughnVernon/IDDD_SamplesMichaelson
I would recommend this example: github.com/vkhorikov/DddInActionDamage
You can have a look here: dzone.com/storage/assets/…Nausea
Got one here: github.com/appie2go/steal-this-codeOlds
feel free to check this: youtu.be/MfEpw2WXXykDehnel
S
225

The difficulty with DDD samples is that they're often very domain specific and the technical implementation of the resulting system doesn't always show the design decisions and transitions that were made in modelling the domain, which is really at the core of DDD. DDD is much more about the process than it is the code. (as some say, the best DDD sample is the book itself!)

That said, a well commented sample app should at least reveal some of these decisions and give you some direction in terms of matching up your domain model with the technical patterns used to implement it.

You haven't specified which language you're using, but I'll give you a few in a few different languages:

DDDSample - a Java sample that reflects the examples Eric Evans talks about in his book. This is well commented and shows a number of different methods of solving various problems with separate bounded contexts (ie, the presentation layer). It's being actively worked on, so check it regularly for updates.

dddps - Tim McCarthy's sample C# app for his book, .NET Domain-Driven Design with C#

S#arp Architecture - a pragmatic C# example, not as "pure" a DDD approach perhaps due to its lack of a real domain problem, but still a nice clean approach.

With all of these sample apps, it's probably best to check out the latest trunk versions from SVN/whatever to really get an idea of the thinking and technology patterns as they should be updated regularly.

Saville answered 13/2, 2009 at 3:2 Comment(4)
As mentionned @Mehdi in the original question comment you should add the wonderful example from Vaughn Vernon. It is the best implementation of DDD pattern so far I have ever seen: github.com/VaughnVernon/IDDD_SamplesCark
I know this is old, but the example from dddps appears to be fully anemic and counter to OOP actually. None of the domain objects have any behavior, and the service layer classes are basically a 1:1 delegation to the repositories. I'm not sure if this should be considered a "good" example of DDD? I'm still learning myself, but the samples in S#arp Architecture seem to be a better example for those learning DDD as it emcompasses both state and behavior, which is good OOP design.Ferdinand
You should now add the excellent sample of Vaugnh Vernon the author of Implementing Domain Driven Design (IDDD): github.com/VaughnVernon/IDDD_SamplesCark
Any project for c++/c or golang user?Minstrel
G
25

Not source projects per say but I stumbled upon Parleys.com which has a few good videos that cover DDD quite well (requires flash):

I found these much more helpful than the almost non-existent DDD examples that are currently available.

Gnosticize answered 13/2, 2009 at 20:56 Comment(1)
links not workingMicropathology
A
15

.NET DDD Sample from Domain-Driven Design Book by Eric Evans can be found here: http://dddsamplenet.codeplex.com

Cheers,

Jakub G

Asiatic answered 2/3, 2010 at 16:27 Comment(2)
sadly link is brokenUnderrate
yep, after 12 years it might :) CodePlex was shutdown on October 21, 2021Asiatic
C
11

Check out Project Silk. Not only does it demonstrate DDD but other cutting edge patterns. This is an excellent resource for any Web Developer. A full overview of the project can be found on MSDN.

Cap answered 15/10, 2011 at 15:29 Comment(1)
Source code not available anymore :(Charged
R
6

This is a good example based on domain driven design and explains why it is important to have separate domain layer.
Microsoft spain - DDD N Layer Architecture

Reticulum answered 22/12, 2011 at 3:27 Comment(2)
I can't vote this down but go to Ayende's blog to see why he thinks this is not a good example. ayende.com/blog/19457/…Ungula
the link you provide doesn't work, message error: 'Project 'microsoftnlayerapp' was not found'Donall
C
6

ddd-cqrs-sample is also a good resource. Written with Java, Spring and JPA.

Updated link: https://github.com/BottegaIT/ddd-leaven-v2

Chessa answered 3/12, 2012 at 22:57 Comment(0)
L
5

Code Camp Server, Jeffrey Palermo's sample code for the book ASP.NET MVC in Action. While the book is focused on the presentation layer, the application is modeled using DDD.

Liverpool answered 5/11, 2009 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.