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
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?