• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Design Patterns - Doubt

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i personally hate such questions where you have to choose "more correct" of the "two correct" answers
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you dont have the head first book ???

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