Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

外观模式在安卓系统中例子 #5

Open
wusp opened this issue Jan 10, 2017 · 0 comments
Open

外观模式在安卓系统中例子 #5

wusp opened this issue Jan 10, 2017 · 0 comments

Comments

@wusp
Copy link

wusp commented Jan 10, 2017

这里的例子选用有问题。
Context-ContextWrapper-Activity 之间不是外观模式
原因在于:
从形式上看,外观模式的Facade一般不会继承自被外观类,以便隐藏原有的接口信息,同时简化本来复杂系统的使用。
从功能上看,Context的子类在持有Context对象的同时动态的为Context添加新的的内容或者改变其中的信息,而完成这种职责的一般是装饰者模式。
综上所述,Context-ContextWrapper-Activity/Application/Service... 这些之间的关系使用的应该是装饰者模式而不是外观模式.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant