The template method allow separate the generic method from a detail context(class) via inheritance
Another advantage:
1.Inheritance implementation means that you will know the actual method implementation class before compilation,it is very big advantage to strategy pattern because it increase viscosity of program.
2.The combination of generic method is limited.
3.The combination of generic method is very meaningful(ease of naming)(allow mapping from requirement).
We normally see it on activity.
I have also see the template method in network layer(implemented by foreigner) with the combination of command pattern.If there is a reply below I will added it and explain.
版权声明:本文为博主原创文章,未经博主允许不得转载。
Template design pattern application in android
原文地址:http://blog.csdn.net/chungchi300/article/details/47004365