Last post Dec 13, 2016 03:53 PM by deepalgorithm
Feb 11, 2013 12:24 PM|tonyjoanes|LINK
I am creating a service that uses a third party API. I do not have control over these classes so just wondered if anything could suggest a pattern to follow that would keep my WCF service contract simple.
The main problem is that the third party API takes in its own types as concrete implementations so its trick to mock these parts of the code. I have started out on the adapter patter route so that I can just give my service contract an interface to use but
I would welcome any other suggestions.
Dec 13, 2016 03:53 PM|deepalgorithm|LINK
This is a very broad question, but I think the Adapter pattern is a solid choice as it will allow you to wrap the 3rd party API with an
interface. Interfaces are very helpful when it comes to mocking and writing unit tests.
A few more patterns to consider are: