I think elements of this question have been answered elsewhere, but I couldn't find an answer to my specific circumstance.
I work with an enterprise application. This application interfaces with various 3rd party APIs & services via what is currently a single class and a plethora of proxy dlls. This means that each of these dlls is referenced in the main project. In addition to this, over time as we've added new service calls, a lot of code has been duplicated, with only very small amendments. Most of the service calls do roughly the same thing and take largely the same objects as parameters.
As you can imagine, this presents us with a number of problems, not least of which is the time it takes to add a new service.
We have a task now to refactor and streamline this process to make it more manageable and resilient - I have an idea in my head and I've done a lot of research but I just wanted to see if anyone had any better ideas or similar experiences before I dive in.
What I want to do is add a facade layer so that the base code gets all the data commonly used and bundles it off to the facade along with a parameter stipulating which service it wants to call. The facade would then pass the data to either the proxies or a bridge, which would transform it into the right format for the target service, make the required calls in order, and return any responses back to the facade to pass on.
Although I have an idea of the architecture I want, I'm not 100% sure which way to go in terms of concrete C# code - whether to add the facade and bridge/adapter code in a new project which also has the proxy dlls referenced, or whether to go down the base/interface route and add the required transformation classes directly into the proxy dlls .
Any suggestions appreciated!
Aucun commentaire:
Enregistrer un commentaire