This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Whizlab's Q ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Whizlab Watch "Whizlab New topic
Author

Whizlab's Q ??

Debanjana Dasgupta
Ranch Hand

Joined: Aug 11, 2000
Posts: 101
Hi
For this Q

You have invented the next generation spell checker that can learn from and automatically correct the common typing mistakes of an individual user. You have already sold licenses to many major software vendors and plan to retire in the sun. However, you are required to make slight changes in the logic to suit each software vendor's individual application needs. What design pattern will help you marginally change the logic in a class for use in different applications?
The answer is Template Pattern.
My question is why not Strategy?
Thanks
Debanjana


Thanks<br /> <br />Debanjana<br /> <br />SCJP2<br />SCEA
Stephen Cowell
Greenhorn

Joined: Feb 07, 2002
Posts: 22
I think your answer is better, but either one is correct. I wouldn't get hung up on that question, the exam is less ambiguous.
Debanjana Dasgupta
Ranch Hand

Joined: Aug 11, 2000
Posts: 101
Thanks for the reply.
I still do not understand where to use Template and when to use Strategy.
They seem to do similar stuff.
Thanks
Debanjana
Shankar Ranganathan
Ranch Hand

Joined: Sep 19, 2001
Posts: 71
I think "Template" is the right one.The important part of this question is "slight changes in logic"
which says that there is a skeleton of the algorithm already and only a few changes to the logic needs to be made.This is ofcourse the template pattern.
Strategy pattern would be more applicable when there is a different set of algorithms and you can implement any one of them using the strategy pattern.
By the by how do you rate the whizlabs questions?

Shankar


Shankar<br />Post mock questions in<br /><a href="http://groups.yahoo.com/group/scea_mock" target="_blank" rel="nofollow">http://groups.yahoo.com/group/scea_mock</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Whizlab's Q ??