There’s a famous quote in the world of Software Development:
“We can solve any problem by introducing an extra level of indirection.”
In my experience, this is almost certainly correct, this post will see us adding in an additional layer of Abstraction to allow us to simplify our Controller(s) and manage our Dependencies in a more straightforward manner.
Last post saw us implement our Translation PCL into our Web API using Dependency Injection. The problem is that our ITranslator Interface only handles a single Translator Implementation, such that when we inject from our Container we can’t currently translate more than one direction. We’ll look into the why’s shortly, but by the end of the post we will have created :
- ITranslatorService Interface;
- TranslatorService Implementation and Unit Tests.