views:

4320

answers:

6

I'm learning about DDD and enjoying every minute of it. However, there are some practical issues that are confusing to me that I think seeing some good samples might clear up.

So being at peace with those issues, does anyone know of some good working code samples that do a good job of modeling basic DDD concepts?

Particularly interested in

  • An illustrative Domain Model
  • Repositories
  • Use of Domain/Application Services
  • Value Objects
  • Aggregate Roots

I know I'm probably asking for too much, but anything close will help.

+19  A: 

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.

Michael Hart
Points well taken. Thanks Michael. These should at least help me visualize some implementation possibilities. I get what you are saying about the process and I agree. Thanks for answering this!
jlembke
+7  A: 

Casey Charlton is currently posting a blog series on DDD.

http://devlicio.us/blogs/casey/default.aspx

Jon Erickson
This one is quite good. :)
Arnis L.
...and, specifically, he's building a 'Parcel Service' app
rohancragg
+5  A: 

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-existant DDD examples that are currently available.

Todd Smith
Those look excellent. Great contribution! thank you.
jlembke
A: 

Time and Money, though it leaves a lot to be desired.

moffdub
+1  A: 

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.

Peter Tate
+2  A: 

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

Cheers,

Jakub G

Gutek