views:

48

answers:

1

On the Domain-Driven Design website I see:

Concentrate all the code related to the domain model in one layer and isolate it from the user interface, application, and infrastructure code. The domain objects, free of the responsibility of displaying themselves, storing themselves, managing application tasks, and so forth, can be focused on expressing the domain model. This allows a model to evolve to be rich enough and clear enough to capture essential business knowledge and put it to work.

What "goes in" the infrastructure code? Does this mean supporting frameworks (for logging, for example)?

I presume "application code" means the domain objects (i.e. the domain model)?

+1  A: 

Infrastructure code would be implementations of repositories for instance. You might have in-memory or Hibernate repositories that live in the infrastructure layer, while their interfaces live in the domain layer.

Application code controls the domain objects. It defines services that take user commands and invoke business logic on domain objects, but no business logic lives in that layer.

Christophe Herreman
So do repositories (in the design pattern sense, not, as I understand it, in the sense of repositories in your answer) typically live in the domain model, or in a separate data access component?
Ben Aston
...and would things like IOC containers, logging and metrics collection subsystems typically be described as residing in the infrastructure code "layer"?
Ben Aston