File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes OCMJEA Mock Question - Design Patters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "OCMJEA Mock Question - Design Patters" Watch "OCMJEA Mock Question - Design Patters" New topic

OCMJEA Mock Question - Design Patters

Mayank Sinha

Joined: Jul 11, 2012
Posts: 4

I was taking one of the OCMJEA mock tests, and came across this question:

Q. ABC Inc. is building a J2EE based application for Order Entry and Management. 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

I answered Mediator, since it promotes loose coupling by keeping objects from referring to each other. That is what JMS on MQSeries is doing here.

But the correct answer, as per the test authors, states it is Bridge pattern where JMS is abstraction and MQ series could be the implementation. The explanation only quotes the GoF definition of the patterns in options.

Could someone please help me understand, how is Mediator pattern wrong here ? (There is only one correct answer to this question)

Esteban Herrera
Ranch Hand

Joined: Dec 25, 2004
Posts: 41

Hello Mayank,

This question is pretty vague. I was intrigued by it and looked up in Google. It turned out the same question was asked long time ago in this forum:

I think that yes, JMS can be an example of a bridge, and overall, the question is talking about the Observer pattern, but again, the question doesn't present us enough elements, we can choose Bridge by discarding all the other answers.

About the mediator pattern, this pattern uses an objet to coordinate all the communication among other objects. These objects don't communicate directly with each other, instead, they communicate through the mediator object. In this case, the question doesn't refer to a mediator object.

Mayank Sinha

Joined: Jul 11, 2012
Posts: 4

Hi Esteban

Thanks for your clarification about mediator pattern. And yes, this question is very vague, does not present enough information to choose a right answer or discard the close but wrong ones.

I found some posts on this question on this forum and others as well, but could not find a definite answer anywhere. I guess it's better to move on and hope such questions do not find place in actual OCMJEA tests

Mayank Sinha

Joined: Jul 11, 2012
Posts: 4

Marking this as resolved, since Esteban has clarified why mediator is not the right option.
I agree. Here's the link:
subject: OCMJEA Mock Question - Design Patters
It's not a secret anymore!