views:

1311

answers:

4

In an MVC application, how is DDD implemented. What are the domain objects? If I map entities to custom objects, where does this mapping logic go, in the methods of the repositories or in the service layer?

+2  A: 

There will be a bunch of learning evolved to answer all those questions.

I would start with the ASP.NET MVC Storefront Starter Kit it uses TDD and not DDD but it is a good place to start. If you really interested in DDD I would suggest reading Eric Evans Book, it is considered the DDD bible by most. Ayende Rahien has also written a book called Building Domain Specific Languages with BOO which may also give some insight into DDD.

cgreeno
What do you mean by TDD vs DDD? They're not opposite things. But maybe I've understood you wrong.
Ionuț G. Stan
I was just trying to convey that the StoreFront Series will provide a lot of the patterns but is built using TDD for the most part.
cgreeno
I made an edit- I was not trying to compare the 2 ideas other then from a very broad design perspective
cgreeno
+2  A: 

There's a great new post series going on over at http://nathan.whiteboard-it.com/archive/2009/03/01/asp.net-mvc-domain-driven-design.aspx that actually is describing from the get go how to go about designing an application with DDD in mind.

Chad Moran
+1  A: 

Take a look at S#arpArchitecture. It is a really great way to get started with MVC and DDD at the same time. Domain objects (Models) are stored in different project from the Controllers and presentation. It has a pretty sweet installation and solution template and great documentation.

It makes good use of the repository pattern which is part of the core of DDD. It also employs several modern "best practices".

Chris Conway
A: 

In an MVC application all you domain specific logic should go in the M of MVC, your Model.

TT