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

抽象工厂模式有误 #21

Closed
jealone opened this issue Feb 27, 2017 · 1 comment
Closed

抽象工厂模式有误 #21

jealone opened this issue Feb 27, 2017 · 1 comment

Comments

@jealone
Copy link
Contributor

jealone commented Feb 27, 2017

抽象工厂模式中,一个工厂能创建一簇对象不是一类对象,见下面的UML图

image

拿原代码中的例子,plant工厂只能创造plant对象,Animal工厂只能创造Animal对象,不符合抽象工厂模式,只能算是工厂方法模式的嵌套,正确的的抽象工厂模式已提PR #20

@TIGERB
Copy link
Owner

TIGERB commented Feb 27, 2017

感谢,学习了~

@TIGERB TIGERB closed this as completed Feb 27, 2017
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

2 participants