Sunday, April 15, 2012

On Passthru's

Our current repository is where all of our queries reside ... i.e. FetchOrders(), FetchOrdersWithLineItems(), FetchOrdersForDate(date), etc. This makes it easy to mock the repository, but also creates a whole bunch of pass-through methods in the service layer (i.e. servicelayer.FetchOrdersForDate(date) returns repository.FetchOrdersForDate(date)).Jess Dec 19 '09 at 17:47
1
That's cool, but you might want to consider methods in the repository e.g. Fetch(), Fetch() and suchlike. These might then be called by FetchOrders() in the service tier. I bet there's a bunch of repeated code you could lose in the repository that way.Jeremy McGee Dec 19 '09 at 20:19


No comments:

Post a Comment