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.
![](http://img.blog.csdn.net/20150722153704205)
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.
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.
相关文章推荐
- Design Pattern in Android Sdk Source Code
- Template Method Design Pattern in Java
- Thinking In Design Pattern——Query Object模式
- 如何在Android程序中使用ACRA3(How to install ACRA3 in your Android application)
- Thinking In Design Pattern——工厂模式演绎
- design pattern——template
- android-Preparing Your In-app Billing Application,Establishing In-app Billing Products for Sale
- Observer Pattern in Symbian application
- design pattern notes [5] - template method
- MVC Design Pattern in Cocoa
- 文献笔记《Analyzing Inter-Application Communication in Android》
- Android Design in Action
- Design Patterns in Android:工厂方法模式
- Expert ASP.NET 2.0 Advanced Application Design (Expert's Voice in .Net)
- How to include *.so file in Android-gradle application?
- Application Installation Failed in Android Studio
- Thinking In Design Pattern——MVP模式演绎
- design pattern notes [5] - template method
- JAVA的依赖注入模式(Dependency Injection Design Pattern in Java)
- Thinking In Design Pattern——Query Object模式