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

Misleading example [Factory Pattern] #52

Open
kshirish opened this issue Apr 29, 2019 · 0 comments
Open

Misleading example [Factory Pattern] #52

kshirish opened this issue Apr 29, 2019 · 0 comments

Comments

@kshirish
Copy link

The example of factory pattern is misleading. Although the definition says,

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

But the example doesn't use any subclasses at all. Whereas, Addy Osmani's example explains it pretty well.

@kshirish kshirish changed the title Misleading example Misleading example [Factory Pattern] Apr 29, 2019
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