zoltantothcom/Design-Patterns-JavaScript

Misleading example [Factory Pattern]

kshirish opened this issue · 0 comments

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.