- Typical solutions to commonly occurring problems in software design (pre-made blueprints that can be customised to solve recurring design problems in code)
- A high-level description of a solution and a general concept for solving a particular problem
- You can see what the result and its features are, but the exact order of implementation is up to you
Anatomy of a pattern §
- Intent of the pattern briefly describes both the problem and the solution
- Motivation explains the problem and the solution the pattern makes possible
- Structure of classes shows each part of the pattern and how they are related
- Code example to make it easier to grasp the idea behind the pattern
Classification of patterns §
- Most basic patterns are known as idioms and usually apply to a single programming language
- The most universal ones are called architectural patterns and are language-independent (can design the architecture of an entire application)
- They can also be categorised by their purpose:
- Creational patterns provide object-creation mechanisms that increase flexibility and reuse of existing code
- Structural patterns explain how to assemble objects and classes into larger structures, while keeping the structures flexible and efficient
- Behavioural patterns take care of effective communication and the assignment of responsibilities between objects