Template design pattern application in android
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.
posted on 2018-01-14 17:49 yjbjingcha 阅读(109) 评论(0) 编辑 收藏 举报