Creational Design Patterns
This design pattern provides the way to create an object of a class as per your project requirement. It means you can control the creation and life cycle of an object in your application. As we have already discussed about different creational design patterns in my previous post, lets have a recall about the creational patterns as below and then we will discuss different types of creational patterns in this post later.
1. Creational Design Patterns
- Singleton Design Pattern
Singleton Design Pattern ensures that a class has only one instance in a application, and it provides only one point of access (a global point of access) to access the running instance of the object.
- Factory Pattern
Factory Pattern ensures that you can create an object of a class by using a factory method (a static method) instead of using new operator, so that you can control all objects and memory used by that particular objects.
- Abstract Factory Pattern
Abstract Factory Pattern is a set of factory classes from which we can use/implement new factory classes as per our requirements. Then we can derive a new class form newly created factory classes instead of directly derived it from Abstract Factory class.
- Builder Pattern
Builder pattern insure that, when we create a complex object, It uses step by step creation process and the final step returns the object of the class.
- Prototype Pattern
Prototype Pattern insures the cloning properties of an object. The cloned object might be different from the original object. For example you might copy a document from your friend and change some points as per your requirement.
-> Please click on Next Page button below for read details on different type of creational design patterns. We will discuss Singleton Design Pattern in the next page and so on.