Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • How is it best to handle communication between services? If Service1 has composite relation with Service2, how do I inject mock repositories for both of them? Commented Aug 19, 2014 at 16:56
  • I created a RepositoryFactory that I inject into every provider, so they share repositories. Commented Aug 20, 2014 at 16:00
  • "My main goal is to make it as easy as possible to switch to another data storage later on" - I have to ask the question, just how likely do you think this will be? I don't think I've ever had to change the data storage later on for any system. But if your aim is to separate concerns so that UI doesn't know about DB design then great. Commented Aug 21, 2014 at 0:27
  • @LachlanB Well there are many old services that we would like to switch out later on. These are old WCF services that we need to use for now because of a complicated business logic required. Later on we would like to go entirely through the Web API, connect it straight to a database, set up a ORM and use that for easy data access. Move the business logic. That's why I structured it to use the repository layer, so it doesn't matter where the service gets it data, just from some repository / data storage. The goal was also to make it easily mockable and testable. Commented Aug 21, 2014 at 9:54