A design pattern defines a way in which we can organize our solution to a given problem. It does not define algorithms that can be used to solve the problem, but rather provides an abstraction about how, for example, the code should be organized, what classes need to be defined, what their granularity will be, and how the different objects will be created.
The design patterns have gained a lot of traction, and the book Design Patterns: Elements of Reusable Object-Oriented Software, though published in 1994, still serves as a de facto reference when trying to understand design patterns.
A design pattern will usually consist of the following elements:
- A problem statement: A problem statement describes what we want to solve and hence also defines the design patterns we can use. The problem statement will tell us about the scope of the design that we are...