This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!

Mayank Sinha

Greenhorn
+ Follow
since Jul 11, 2012
Mayank likes ...
Oracle Spring Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mayank Sinha

Hi Dhirendra

Just a hunch, but are there any Hugepages configured, which might be reserved for some other user processes.

Thanks,
Mayank
9 years ago
Marking this as resolved, since Esteban has clarified why mediator is not the right option.
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

Thanks
Mayank
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)

Thanks.