I have been seeing lots of question in David BridgeWater's book. These questions are really testing whether you can really give a choice, provided with a design scenario. A sample question is -
A company has a message queuing system, accessible with complex Java APIs. The company wants a new web application but also wants to minimize the specialized knowledge required to write business code that accesses the queuing system. Which J2EE patterns might best help the company with this problem? (Choose two.) A. Front Controller B. Front Director C. Business Controller D. Service Locator E. View Controller F. Business Delegate
this is how a HFSJ reader proceeds -
weed wout B,C,E - as no pattern by such name ! now what remain are - A,D and F. now since the question talks of BUSINESS CODE , we weed out A. so the answer are D,F ( the innocent HFSJ reader thanks to the question as it tells how many options to choose ).
but here is the explaantion give in the Davi BridgeWater book !
D and F are the correct answers. The Service Locator pattern can be used to isolate the code that finds references to the objects that give access to the queuing system. The Business Delegate pattern can be used to translate simple method calls (used by the business code) into the complex method calls required by the queuing system.
A is incorrect: Front Controller doesn�t address complexity at the model end. B, C, and E are incorrect because they have made-up or incomplete pattern names.
dont you guys get shocked by rading stuff thats in bold ? I do agree that the question is manageable, but....!!
one more -
1. Which of the following patterns can reduce network overhead? (Choose one.) A. Model View Controller B. Business Delegate C. Service Locator D. Transfer Object E. All of the above F. B, C, and D above
the HFSJ reader is excited by the word - reduce network overhead and he quickly chooses D. but here is what david bridge water says -
1. F is the correct answer. Business Delegate can reduce network overhead by caching results of executing business methods (where appropriate). Service Locator can cache references to remote objects to avoid making repeated networked calls to (mostly) JNDI code. Transfer Object collects together lots of data that might otherwise be garnered by repeated network calls. A is incorrect�Model View Controller is about the separation of concerns and doesn�t directly address any network issues. B, C, and D are all patterns that contribute to reducing network overhead, but no one of these answers is correct on its own. E is incorrect because MVC is included in the list.
so , DOES HFSH ADDS ALL DIMENSION THAT ONE MUST THINK IN, WHILE ASWERING THE DESIGN PATTERN QUESTIONS ?
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ] Performance is a compulsion, not a option, if my existence is to be justified.
Why am I seeing Design Patterns in mock exams that aren't in the objectives? Mock exams, as well as the real exam, contain answer options other than the 6 Design Patterns from the objectives. Those extra patterns are never the correct answer. Ever. Use this knowledge to your advantage.
I think it helps a lot if you have already had the chance to work on a project where design patterns were implemented. Else the concepts remain very abstract and it's harder to memorize and to choose the right design pattern that suits best to a situation.