Win a copy of Spring Boot in Practice this week in the Spring forum!

Joel Schnider

Greenhorn
+ Follow
since Jan 25, 2006
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 Joel Schnider

Thanks all, for the clarification.
I found this question here:
http://www.geocities.com/subra_73/SCEA_Practice_Questions.htm
----

31 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



Choice D is correct.



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 MQ Series, TIBCO Rendezvous and Vitria Businessware. Hence choice D is correct.

Observer (GOF 293)"Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically." Hence choice A is incorrect.

Mediator (GOF 273)"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 lets you vary their interaction independently." Hence choice B is incorrect.

Adapter (GOF 139)"Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces." Hence choice C is incorrect.

Visitor (GOF 331)"Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates." Hence choice E is incorrect.

----

My question is how can such a vague question have one correct answer? Contrary to the explanation above, I think Bridge is the wrong answer.

I would argue that JMS is an example of the Observer pattern here, since messages on the MOM are used to push out changes to other subsystems.

I could also argue that MOM is a mediator here, since it decouples various subsystems from each other. Instead of subsystem A knowing abt subsystem B and/or subsystem C, it just knows abt the JMS destination where it is supposed to publish its events! The MOM acts like a mediator here.

I may be wrong, but how does one tackle such questions on the exam?
I would just place a note near the last step, mentioning that another use-case is initiated at that point.

Unless it is absolutely necessary for it to be graphically depicted, like say the whole thing is happening under one huge transaction or something. Even then, perhaps a UML note would suffice instead of inventing stereotypes!

Thats just my opinion.


Originally posted by brownie brownie:
Once you've done one use case as a sequence diagram, how do you show that the last step is to kick off another use case?

As far as i can see the options are to make the second use case an actor or an object (a business delegate perhaps) and then make the last step of the first sequence diagram call a method on the object/actor to "execute the use case".

What's a folks' thoughts on this?

Wrong Forum!

Originally posted by vasanthi chettiannan:
Hi,

I am preparing for scwcd certification.i wrote some of the mock exams in jDiscuss where most of the questions are theoritical unlike SCJP.can anyone please tell me how will be the question pattern and if u ppl could suggest any of the useful sites for mock exams it would be great.Thanks

You may be right, but I don't fully understand your design.

Isn't the remote interface of my CMP the same as the DAO interface of your CMP?



Originally posted by Erik:
Hi Lokesh,


The arguments you give are well-known. Wrapping BMP entity beans by DAOs to make it easier to migrate to CMP. Nevertheless, I am advocating the use of DAOs even with CMP. In other words, not using entity beans as 'business objects' but simply using them as an implementation of a persistence mechanism hidden behing a DAO interface.

Cheers
Erik