开发者

Which design-pattern is right in this scenerio?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜