views:

65

answers:

1

Hi All,

I am trying to understand Asp.Net MVC with DDD following is the structure of application according to the http://aspnetdesignpatterns.codeplex.com/

Application Layers

Presentation Layer => MVC views,

Controllers(MVC) => MVC Controllers class,

Cached Service => ?,

Application Service => ?,

Domain Model => ?,

Repository => repository class to interact with DB,

Infrastructure => Class for logging, mailing etc.

here m having confusion in Application service and domain model, where should i fit my business logic (in service or in domain model)

what exactly should be in service and what should be in domain.

e.g suppose i want to add customer in DB how should be the flow..?

as i know,

in controller class i will write like

var customeService = new CustomeService (_customerRepository);
customeService.Add(customer);

if m wrong please correct me here..

_customerRepository goes in repository

what goes in model and what should be the flow of code.

please clear me. thanks in advance.

A: 

Have You read this book? Start with that.

Term Service is overloaded.

Domain services encapsulates small part of domain logic that does not fit naturally in any of domain object (some say it's a sign that there's unidentified aggregate root in Your domain).

Application services contains zero domain logic. They coordinate domain.

Infrastructure services seems to me quite self-explanatory. Those contain technical details.

Arnis L.