Repository v Service

Mar 5, 2012 at 4:31 PM


First of thanks for this P&P.

Can you tell me why who have chosen to place code with logic in the Repositories rather than a Service.

I’d of thought that the Repositories should be a clean implementation of the “classic” IRepository interface. And any/ all code should be placed in the services.

By having implementation code in the repositories this could make it harder to test. And, if say the specification pattern was to be implemented at a later stage

Mar 6, 2012 at 3:43 PM


You might find the following thread useful, where a similar discussion is addressed in which an explanation for this choice is proposed by Karl Shifflett:

Additionally you could check the following work items, where different users suggested changes in the way the pattern is implemented:

I hope you find this helpful,

Agustin Adami