Vítor Silva

Vítor Silva

  • NA
  • 58
  • 1.2k

How to architect a comunication of objects between 2 SW-B2B?

Apr 21 2018 4:00 PM
There's a 1st software (s1) that generates data and then there's one or more software's (s2, s3) that will receive that data(objects), based on pre-configured actions that define the type of data to transmit. A middleware (api) needs to get the data from s1 and convert it to s2 or s3 structure depending on configuration. The thing is there's some validations during conversion that's depends on the destination (s2 or s3) of the data. The objective is to support a wide range of destination softwares. The Adapter pattern seems to be the best way to reuse as much of code to different actions or destinations, but i'm afraid that the management of it in the future may be even difficult and complex. Is there any other approach that makes it easier to implement or maintain, as separate parts as possible? what am i missing?
 
PS: I inherited the current api, but i'm trying to convince my colleagues to refactor it, and i need some arguments, best examples,
 
Thank you for your help!
 
What I have tried:
 
So far i used interfaces, which derived the converter of (s1 or s2), with an instance factory that returns the correct instance of the current configuration. Overal with seems to do the trick, but its not easy to maintain the different actions(object data type) as it needs a method for each object type conversion, in each of the numbers of destinations classes. Also when a parameter changes I'm forced to update the interface and every other method that applies it. This seems rather work full to maintain in the future.

Answers (1)