Design Patterns are solutions created for common problems in software. They can be thought of as pre-made plans that can be customized and used to solve common problems in code. Design patterns are general concepts used for problem solving, not parts that can be found ready-made, such as a function or class, and added to the code.
Factory Design Pattern requires designing an interface for object creation and allows subclasses to produce objects. In addition, the subclasses themselves determine which class object will be created. Thus it abstracts the object creation process. It is one of the creative design patterns and is frequently used in software.
Abstract Factory is a creational design pattern, which solves the problem of creating entire product families without specifying their concrete classes. Abstract Factory defines an interface for creating all distinct products but leaves the actual product creation to concrete factory classes. Each factory type corresponds to a certain product variety.
A singleton is used to ensure that there is only one instance of an object and that the same (and only one instance) is called everywhere in your code whenever you need that object.
Composite is a structural design pattern that allows composing objects into a tree-like structure and work with the it as if it was a singular object.
Decorator pattern allows a user to add new functionality to an existing object without altering its structure. This type of design pattern comes under structural pattern as this pattern acts as a wrapper to existing class.
This pattern creates a decorator class which wraps the original class and provides additional functionality keeping class methods signature intact.
Chain of Responsibility is a behavioral design pattern that allows you to pass requests along a chain of handlers. After receiving a request, each handler decides to process the request or forward it to the next handler in the chain.
Command is a behavioral design pattern that turns a request into a stand-alone object that contains all information about the request. This transformation lets you pass requests as a method arguments, delay or queue a request’s execution, and support undoable operations.
Mediator is a behavioral design pattern that lets you reduce chaotic dependencies between objects. The pattern restricts direct communications between the objects and forces them to collaborate only via a mediator object.
Strategy is a behavioral design pattern that turns a set of behaviors into objects and makes them interchangeable inside original context object.
Visitor is a behavioral design pattern that lets you separate algorithms from the objects on which they operate.
Proxy is a structural design pattern that lets you provide a substitute or placeholder for another object. A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object.