q****x 发帖数: 7404 | 1 can any daniu concisely describe their difference with example?
google doesn't return any good refernce. |
l*****a 发帖数: 14598 | 2 template method will call virtual function inside it
strategy means u can change the way to do something
【在 q****x 的大作中提到】 : can any daniu concisely describe their difference with example? : google doesn't return any good refernce.
|
b*2 发帖数: 94 | 3 template is like a trigger, which package several abstract methods.
Different sub-class could have different implementation. And our cute
trigger will launch all those methods.
Strategy is pretty strightforward, get the algorithm based on the context. |
q****x 发帖数: 7404 | 4 in case of template, if there's only one abstract method in the package,
will it be also a strategy?
【在 b*2 的大作中提到】 : template is like a trigger, which package several abstract methods. : Different sub-class could have different implementation. And our cute : trigger will launch all those methods. : Strategy is pretty strightforward, get the algorithm based on the context.
|