They are templates that identify problems in the system and provide appropriate solutions to general problems that developers have faced over a long period of time, through trial and error.
In 1994 the “Gang of Four” (GoF) formed by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published the book “Design Patterns, reusable object-oriented software elements”; where the design pattern is introduced in software development and 23 common patterns are documented to solve a specific problem
Patterns are classified into 3 types, “Creational Patterns“, “Structural Patterns“, “Behavioral Patterns“, where:
Creational patterns
They provide various object creation mechanisms, which increase flexibility and reuse of existing code in a way that is appropriate to the situation. This gives the program more flexibility in deciding which objects should be created for a given use case.
Structural patterns
They facilitate efficient solutions and standards regarding class compositions and object structures. The concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionality.
Behavior patterns
They deal with communication between class objects. They are used to detect the presence of communication patterns already present and can manipulate these patterns.