您的位置:首页 > 移动开发 > Android开发

Template design pattern application in android

2018-01-14 17:49 429 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: