Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what design pattern or architecture to use with third party api [closed]

I'm currently evaluating a third party software which provides web based document viewing and a image processing using a proxy server. I'm starting to think about how it would be integrated into my web application which consists of Angularjs on client side and a web API backend using .net c#.

What would be the best architecture and design solution to consume the 3rd party api? I.e. following a design pattern, wrapper class, loosely coupled, etc.

If you require some more information please let me know.

like image 371
user1334589 Avatar asked Oct 17 '25 13:10

user1334589


1 Answers

This is a very broad question so here are a few of the more useful Design Patterns, you may need to use one or more of these depending on what you are trying to do:

  1. Adapter - If you want to wrap the 3rd party API with an interface that fits better into the rest of your system.
  2. Facade - If you want to simplify interacting with the 3rd party library by going through some kind of helper class.
  3. Bridge - Define a new intermediate interface between your code and the 3rd party library. This is most useful if the 3rd party library is subject to future changes, any changes will only affect the one class that communicates with this 3rd party library leaving the rest of your system unaffected. The Bridge Pattern is also useful if you need to switch to a different but similar 3rd party library; again making you only change one class.
like image 195
dkatzel Avatar answered Oct 19 '25 05:10

dkatzel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!