I came across this sample SCEA question and I would like you guys to help me with the answer. Also, please give an explaination why that answer is correct.
Question : Julia Fractals Inc. is building a J2EE based application for Order Entry and management of their fractal software. Once the order is taken, it is submitted to a relational database. A provisioning system then queries data and makes appropriate calls to various subsystems using JMS on MQ Series. What design pattern is JMS an example of here?
Makes me feel the answer is Adapter. But I am not sure. Let me know your thoughts.
I know its not Mediator. Should be either Observer or Adapter.
Here is the reason, why I think it might be adapter.
"A provisioning system then queries data and makes appropriate calls to various subsystems using JMS on MQ Series" -- This means the provisioning system cannot directly call the other subsystems. ie, no way to invoke the subsystems directly. The JMS is acting as a "Messaging Integration" scenario, the bridge between the provisioning system and the other subsystems ( Don't confuse with the word bridge, bridge pattern is something else). So, Adapter looks to be right choice.
Above logic is why I am saying it be Adapter. But as I am a newbie to Patterns, I need someone to validate this. Experts please help.
If your power cable does not match to the wall socket then you use an adapter. That is the basis of adapter patter. In here, no hint about mismatching interfaces between main system and sub systems. So I think Adapter is not correct.
On other hand, generally Mediator acts as a middle man to couple of components. That reduces the coupling between components and add a new layer (mediator) in between components. Mediator responsible for message (dont be confused with JMS messages) handling between components. In here JMS does that. Thats the reason to Im arguing Mediator is also correct.
Recognise this question from the whizlabs SCEA 5 part I mock exams. Bridge pattern should be the correct answer.
Bridge (GOF 151) Decouple an abstraction from its implementation so that the two can vary independently. In this case, JMS is the abstraction. The implementation could be for instance MQ Series, TIBCO Rendevous, Vitra Busninessware.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop