JavaScript Factory Pattern

/ Published in: JavaScript
Save to your folder(s)

The Factory Pattern suggests defining an interface for creating an object where you allow the subclasses to decide which class to instantiate. This pattern handles the problem by defining a completely separate method for the creation of objects and which sub-classes are able to override so they can specify the ‘type’ of factory product that will be created.

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.