Hello all,
in a mock
test I found the following question:
"...for asynchronous communication A communicates with B using JMS and MQSeries. Which design
pattern describes the use of JMS the best."
Possible answers amongst others: Mediator or Bridge
I thought it's Mediator but the correct answer is Bridge.
Thinking about it, it makes total sense since some
J2EE APIs such as
JDBC, JNDI and JMS use the bridge patterns to bridge to the providers implementation.
However, Mediator does exactly what JMS does:
"Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently."
So which one is more correct? Mediator or Bridge?
D.