Purpose of Design Patterns
Explore how design patterns address recurring coding challenges and establish a shared vocabulary among developers. Understand when to apply patterns like SOLID or Gang of Four, and discover the balance between composition and inheritance. This lesson encourages applying design patterns even in unconventional areas like logging to improve code maintainability and clarity.
We'll cover the following...
While writing code, developers consistently solve problems of various kinds. In some cases, they need to decide how to connect objects. While in other instances, the challenge lies in expressing a specific type of behavior. These are discreet kinds of problems. Many engineers have found repetitive patterns of questions as well as answers to them. That is why design patterns (see software design pattern) exist; to solve repeating types of problems in a standard fashion instead of reinventing the wheel.
Another reason for following and applying design patterns is to establish a common vocabulary and knowledge among developers. For example, if I tell you that I implemented a retry mechanism via a decorator pattern, that already communicates my solution’s essence. Alternatively, you could suggest to your ...