Chapter 6. Advanced Object Creation
The JavaScript Object-Oriented Programming model has no classes, and it is directly based on objects, whose creation process may happen in different ways. We already talked about the standard ways in which we can create objects, but in some situations, we may need a more sophisticated approach.
This chapter introduces the group of design patterns known as creational patterns, that is, patterns concerning the creation of an object in a structural way. After a reminder on the standard ways to create objects, we will show you how to take advantage of the following patterns:
- Singleton pattern
- Factory pattern
- Abstract factory pattern
- Builder pattern
- Object pool pattern