Samples for Domain Driven Design (esp .NET focused

2019-03-08 04:25发布

问题:

Ok so I've ordered Applying Domain-Driven Design and Patterns: Using .Net, but while I wait for it to arrive I'm looking at starting to apply the techniques in my current project. I really grasp the concepts quite well now, but when I try to apply them I get caught up with the execution and end up leaking my respsonsibilities across the various projects. As such I'm looking for resources out there that can guide me in the right direction, especially sample projects with actual code that I can work against. I remember a sample site out there in the Alt.Net world that had a real working project that people could browse but can't seem to find it? Does anyone out there have that link, or any other links they could share??

Edit: I have since found this sample application from the DomainDrivenDesign.org site (although it is Java based) as well as the example outlined below.

I am still looking for the Alt.Net sample application if anyone knows where to find it?

回答1:

The following CodePlex projects seem to be right up your ally:

  • .NET Domain-Driven Design with C#: Problem-Design-Solution
  • Domain Driven Design (.NET) Example Application
  • StoreDDD


回答2:

Mark Nijhof made a great .Net example app using the CQRS pattern which is a hot implementation of DDD. You can read all about it on Marks blog



回答3:

The author of Domain-Driven Design has created a project Time & Money as a showcase for the concepts described in his book. This is more than just a 'toy' project that provides some sample code to accompany the book, it's intended to be a production-ready replacement for the concepts of time and money, which are rather poorly implemented in the core Java libraries.



回答4:

I've written a few articles with mostly c# examples on implementing DDD patterns in real applications.

  • A Class Isn't Always a Noun
  • DDD in the small (php)
  • Specification pattern example in c#
  • An Order Processing Pipeline in ASP.NET MVC


回答5:

Habanero is a developement framework that implements Domain Driven Design Principles it is an excellent source of material and an open source community dedicated to domain driven design in .Net.



回答6:

You can take a look at my DDDSample.Net. It demonstrates not only classic DDD, but also CQRS approach using two relational stores and using Event Sourcing approach.



回答7:

I found Steve Sanderson's post Behaviour Driven Development (BDD) with SpecFlow and ASP.Net MVC and it's accompanying example project (Guestbook) invaluable in making this step from theory to practice. I must admit I was able to re-use a lot of his code in my own application without too much modification from what was originally intended as a simplified example.

He uses WatiN (a tool for automating browser tests) to to do full acceptance testing from a user perspective. His example also includes a typical CRUD feature (create/update forms etc.), which is something so many examples avoid, even though it must be one of the most common things all of us do.

Sanderson's one of those people who can break complicated ideas down into clearly understandable descriptions, and has a very pragmatic view on development practices.



回答8:

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/



回答9:

As part of a talk I have done at a Dutch .NET community event, I have started implementing a full-blown Silverlight 4 example using CQRS and Event Sourcing. It relies heavily on one of the most serious open-source CQRS initiatives, NCQRS. You can find its corresponding CodePlex site here.