Last post Mar 29, 2012 11:38 AM by ammd
Mar 29, 2012 05:19 AM|kidshaw|LINK
I am looking to use the repository model with an MVC based web application I am developing. I am new to MVC and the repository model so want to start off using it correctly.
In my application I have implemented two repositories, each relating to two datasets. The first dataset provides access to a set of lookup tables. The second relates to operational data I am storing.
In my second repository I require values from the lookup repository in order to convert values before they are stored.
My question is, what is the best design for cross-linking repositories?
Sorry if this is vague, I am trying to be generic.
Mar 29, 2012 08:29 AM|ammd|LINK
I would use interfaces and pass them to each other in constructor so there is no dependency on the concrete type and you can pass in any repository that would implement the interface.
Hope this helps put you in the right direction.
Mar 29, 2012 09:05 AM|kidshaw|LINK
Hadn't thought of that approach - would help with mocking too
Mar 29, 2012 11:38 AM|ammd|LINK
Yes it should.