This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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 J2eepattern 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?
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.