Creational Design Patterns abstracts the instantiation of the objects. A simple question may occur to you: Why can't I just create a new Object using the new keyword and be happy thereafter. The answer is Yes, you can create an object. But you need to ask a couple of important design questions before conclusively saying Yes.
- Is my design flexible?
- Will my design promote re-usability?
More often than not, instantiating an object with a new keyword would not result in a good design. We need to see how we can design a system that is both flexible and that promotes reusability. There are totally five creational design patterns which we will see in details one by one. They are,
- Abstract Factory
- Builder
- Prototype
- Factory Method
- Singleton
More on each of them in the following posts.
No comments:
Post a Comment