why do we use design pattern
Design Pattern - Factory Pattern. Factory pattern is one of most used design pattern in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a common interface.
A book such as Elemental Design Patterns can help you learn the design patterns literature from the ground up. Elemental Design Patterns starts with the basic concepts that you use every day, and illustrates the core of programming in terms of patterns.