开发者

Which design-pattern is right in this scenerio?

开发者 https://www.devze.com 2023-03-14 20:01 出处:网络
In a problem scenerio, I have to call five different vendors complying to same industry web service API. Based on the output received from each, I would chose best among all and perform remaining busi

In a problem scenerio, I have to call five different vendors complying to same industry web service API. Based on the output received from each, I would chose best among all and perform remaining business logic.

My questions are:

a) What pattern would fit best in this scenerio?

b) How can all vendors be invoked in parallel using Java EE?开发者_高级运维


Actually it's a matter of taste to choose a pattern here. I would recommend Composite pattern to use. You can add new vendors lately to it without much changing. Probably you need to write a method CompareTo() or Evaluate() where you can select the best result among all.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号