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.
精彩评论