I am creating a class library that interacts with various third-party APIs. I used the facade template to simplify access to complex and confusing calls and the factory template to return the correct implementation. Now I'm trying to build one of the realities, but I do not think about elegant design.
The implementation I create requires the creation of a URL (which I do through URIBuilder). Then I need to "execute" the URL. Then I deserialize the Xml result into a class.
I plan to use HttpClient to call the api with the created URI, but not sure how to structure the class. The options I was thinking about are the following:
The base class of my implementation, so you can call it through base.InvokeURI(Uri myUri) .
The separation class, so it can be used by several implementations
I am also not sure where deserialization should exist.
Ketchup
source share