views:

96

answers:

1

Hi all,

currently the system I am working on is layered like this

  • Web UI
  • Application
  • Domain
  • Infrastructure

In which layer would I put the specification implementations? Infrastrucutre?

+2  A: 

Specifications are part of the Domain Model.

This pattern is described in Domain-Driven Design, and since this book deals explicitly with Domain Modeling, I think it's fair to say that it belongs in the Domain Layer.

Mark Seemann
Yes, the interface is located in the domain layer. But I am talking about the actual implementation that is being injected.
Chris
I would still put it in the Domain Model. However, it may use injected dependencies that are implemented elsewhere. See here for an example of what I mean: http://stackoverflow.com/questions/1264944/refactoring-domain-logic-that-accesses-repositories-in-a-legacy-system/1265055#1265055
Mark Seemann