File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Need help with Patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Need help with Patterns" Watch "Need help with Patterns" New topic
Author

Need help with Patterns

Naveen K Sinha
Greenhorn

Joined: Mar 16, 2004
Posts: 12
Guys,

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?

A Observer
B Mediator
C Adapter
D Bridge
E Visitor
---------------------

Makes me feel the answer is Adapter. But I am not sure. Let me know your thoughts.


Thanks,
Naveen
stanislav bashkirtsev
Ranch Hand

Joined: Aug 17, 2009
Posts: 75
makes appropriate calls to various subsystems
It's an Observer. Observer consists of Subject that has a list of Observers. When some event is triggered, this Subject iterates the whole list and invoke some method in each of Observers.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61611
    
  67

"Naveen S", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vamsi Mohan
Ranch Hand

Joined: Jun 20, 2009
Posts: 80
Yes, It is observer pattern. It observe calls from various sub-systems and receive data.


VAMSI MOHAN.V
(SCJP5.0, IBM Rational Solution Designer, IBM Rational Architect, IBM RUP Designer)
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402

Yes, I agree to Observer. I think that is the perfect answer. But what about the Mediator. I feel its also closer answer.

Thanks
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
I think it's Adapter. The question asks pattern of JMS, don't get confused.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Naveen K Sinha
Greenhorn

Joined: Mar 16, 2004
Posts: 12
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.

Thanks,
Naveen
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402

Hi All

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.

Thanks
Ronald Roest
Greenhorn

Joined: Sep 02, 2009
Posts: 4
Dear all,

Recognise this question from the whizlabs SCEA 5 part I mock exams. Bridge pattern should be the correct answer.

Quote:

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.

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with Patterns