Join Jungwoo Ryoo for an in-depth discussion in this video Quality attributes and design patterns, part of Python: Advanced Design Patterns.
- [Instructor] When building a software application, it is critical to ensure that its overall quality meets the expectations of end users. These quality attributes include non-functional requirements such as performance, security, and maintainability. Imagine an operating system that provides you all the features in the world. It is voice-activated, and works with numerous devices plugged into your computer.
However, the OS is extremely vulnerable to security attacks. Would you buy such an OS if you had a choice? You'll at least be hesitant, I'm sure. In this scenario, the features of the OS are functional requirements which address what the OS does. On the other hand, the security properties of the OS are nonfunctional requirements, or quality attributes, because they characterize the OS as a whole, and how it behaves.
Design Patterns are related to both functional and nonfunctional requirements. They are tied to functional requirements because they are design solutions that enable a specific software feature behind the scenes. For example, you can leverage the adapter pattern to gracefully handle your need to connect to various databases that necessitate the use of completely different interfaces. If the adapter pattern fails, your software no longer functions because it cannot communicate with its remote databases anymore.
When consistently used throughout your coding process, the adapter pattern also increases the maintainability of your software. In the case of the database example, the adapter pattern makes it possible to contain a change in a single, isolated location instead of resulting in widespread code modifications in numerous places. This in turn, promotes the maintainability quality attribute of your software.
As you can see, design patterns are more directly connected to functional requirements, but their use also indirectly affects the quality attributes of your software. The positive influence of design patterns on quality attributes is one more reason to use them.
- Architectural vs. design patterns
- Why use design patterns?
- Design best practices
- Domain-specific patterns and security patterns
- Gang of Four design patterns
- Command, Mediator, and State
- Template method