1

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?

Chris
  • 7,229
  • 7
  • 41
  • 57
  • what do you exactly mean by specification implementation? – bertolami Jan 06 '10 at 10:06
  • I mean the various implementations that than are injected into the domain layer. – Chris Jan 06 '10 at 11:09
  • It would be easier to answer the question if you are more specific. Maybe a diagram? What is the "Infrastructure" Layer. What is running your "Application" Layer, J2EE or .Net? Thanks :) – LeWoody Jan 06 '10 at 16:03

1 Answers1

4

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
  • 225,310
  • 48
  • 427
  • 736
  • Yes, the interface is located in the domain layer. But I am talking about the actual implementation that is being injected. – Chris Jan 06 '10 at 10:58
  • 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 Jan 06 '10 at 11:16