Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design Patterns - Doubt

 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your web application uses a session bean component in a distributed application to make a specialized calculation such as validating credit card numbers. However, you want to shield your web component from the code involved with looking up session bean component and using its interface.

You want to decouple the local application classes from the looking up and use a distributed component whose interface could change. Which J2ee pattern is appropriate?

A. Transfer Object
B. Service Locator
C. MVC
D. Business Delegate

Answer in HFSJ states only "D". Why cannot it also be B? I mean should BOTH B and D be the answers?
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all there are only two options which matched those are
B and D
Now we have to decide which of these two are most appropriate.
Now B alone is not possible.
It can be D or D and B
Now question is asking for
decouple the local application classes from the looking up and use a distributed component whose interface could change
So answer is D
Actually Service Locator is helper for Business Delegate and question donot specify choose all that apply.
 
Vikrant Pandit
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i personally hate such questions where you have to choose "more correct" of the "two correct" answers
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shield your web component

the moment you see the word SHIELD, select the business delegate !

the WCD pattterns review section in head forst has lots of such HIT WORDS,
which if you remember you have fair chnces of anwering any question on design patterns !

hth
 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Niranjan, I don't have the Head First book. Could you post some HIT WORDS of design patterns at here, thanks a lot.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you dont have the head first book ???

damn it ! you dont have the KEY TO SUCCESS !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic