Skip to content

Factory

Bartłomiej Smykla edited this page Dec 10, 2016 · 1 revision

The factory pattern depends heavily on interfaces. Without some way of checking an object’s type and ensuring that it implements the needed methods, you will lose a lot of the benefits that you would gain from the factory. In all of these examples, you can create objects and treat them identically because you can ensure that they all respond to the same set of methods. Pro JavaScript Design Patterns

Clone this wiki locally