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

Java面向对象设计之桥接模式 | 闪烁之狐 #71

Open
blinkfox opened this issue Dec 18, 2018 · 0 comments
Open

Java面向对象设计之桥接模式 | 闪烁之狐 #71

blinkfox opened this issue Dec 18, 2018 · 0 comments

Comments

@blinkfox
Copy link
Owner

https://blinkfox.github.io/2018/12/19/ruan-jian-she-ji/she-ji-mo-shi/java-mian-xiang-dui-xiang-she-ji-zhi-qiao-jie-mo-shi/

模式动机设想如果要绘制矩形、圆形、椭圆、正方形,我们至少需要4个形状类,但是如果绘制的图形需要具有不同的颜色,如红色、绿色、蓝色等,此时至少有如下两种设计方案:

第一种设计方案是为每一种形状都提供一套各种颜色的版本。
第二种设计方案是根据

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

No branches or pull requests

1 participant