My requirement is to send diff actions to vendor through rest API (actions will be for ex: simple notes, some docs etc through xml payload). I will have to support unit testing (so logic should be decoupled from UI) for all the actions and more actions can be added in future also. So when i click on Action button, a list of actions will be displayed and on select of one particular action above sending to vendor logic is executed. I felt lot of code can be reused here and only different thing would be forming payload. Can any one please suggest a good design approach/pattern i can use to reuse the code and decouple logic from UI?
What I have tried:
I have have tried view model concept and it helps me to decouple the logic. But am not sure which pattern will help to reuse the code?