You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
kshirish
changed the title
Misleading example
Misleading example [Factory Pattern]
Apr 29, 2019
The example of factory pattern is misleading. Although the definition says,
But the example doesn't use any subclasses at all. Whereas, Addy Osmani's example explains it pretty well.
The text was updated successfully, but these errors were encountered: