I have a software that communicates with api of a website. How could I increase its functionality to connect to various other api's without touching the code in it? I think the easiest way is to write a proxy that resides between api and softwre translates incoming messages from other api to the base api that this software "understands". Where should I look for more information on implementing this proxy using c#? Thank you for help.
Asked
Active
Viewed 109 times
1 Answers
1
Hmm sounds like one of the Software design patterns you come across every day. I think what fits best with your "proxy" is actually bridge.
From sourcemaking
Intent
- Decouple an abstraction from its implementation so that the two can vary independently.
- Publish interface in an inheritance hierarchy, and bury implementation in its own inheritance hierarchy.
- Beyond encapsulation, to insulation
Problem
“Hardening of the software arteries” has occurred by using subclassing of an abstract base class
to provide alternative implementations. This locks in compile-time binding between interface
and implementation. The abstraction and implementation cannot be independently extended or composed.
The example in C# is http://sourcemaking.com/design_patterns/bridge/c%2523
However if you just want the proxy design pattern (which imho doesn't suit your problem) is listed here:
EDIT: Ok, for a more generalised solution, go with Proxy pattern and look at existing implementations for proxies. You'll find quite a few answers to that answer question on this site:

Community
- 1
- 1

Daniel Fath
- 16,453
- 7
- 47
- 82
-
Hi, thanks for reply. I thought more of a real proxy server running on local machine to receive a communication from software (which I did not mention much about but is old and complicated, what makes it extremely time consuming to update) and translate these messages to other api and connect with the other api. I found this: http://www.codeproject.com/KB/IP/mywebserver.aspx, and thought this could be a base for this server ... am I correct in my reasoning? – Macin Jun 30 '11 at 22:09