What are design patterns and why use them?
The experience that endorses us has helped us realise the importance of learning to establish patterns and components within each Design System.
A pattern is a set of:
A pattern is a tested solution that can be applied successfully to a given series of problems that appear frequently in a field.
A little bit of history…
In 1994 the book “Design Patterns: Elements of Reusable Object-Oriented Software” was published. This publication started the concept of design pattern in software development. All four authors, Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, were named the GoF — Gang of Four. Within tech circles it’s usual to see the nickname GoF and, even though the book was published over 20 years ago, it still remains a best seller on Amazon.
What are design patterns?
Design patterns had their genesis in the nineties decade, thanks to the publishing of the book we mentioned earlier, and since then they were widely accepted in the software development field, from companies all the way to academic institutions.
The GoF gave a precise definition of what a design pattern is and how it must be used: “object descriptions which communicate between them and classes that are personalised to solve a general design problem in a particular context”.
The concept of pattern represents one of the more attractive points of view to reuse design knowledge. The term “pattern” is used to describe software abstractions which are used by expert designers and programmers while developing their applications.
Design patterns describe solutions to specific design problems that come up while polishing a global design. These patterns may be dependent or independent of the app’s domain. In the first case, design patterns are applied to design problems in specific domains, such as graphic or hypertext functions. Independent domain patterns give solutions to produce structures that are flexible in design and that can be easily adapted to new requirements.
In short, we could say that a design pattern is a solution to a given design problem and that we try to use designs that have proven previously their effectiveness somewhere else. Design patterns describe appropriate solutions to problems that appear repeatedly, making design more flexible, elegant and mainly reusable. These solutions may be applied repeatedly so we can produce design structures that look similar while developing different applications. Each pattern is focused on a specific design problem which is oriented to a particular object.
In order to a solution to be considered a pattern it must achieve certain characteristics:
- It must have proven its effectiveness solving similar problems in previous occasions.
- It must be reusable, which means that it is applicable to different design problems in different circumstances.
Design pattern examples
Some years ago, when responsive design gained significance, designers were talking about a design pattern regarding the “Back to Top” button. Even Nielsen Norman themselves wrote an article with nine guidelines to develop and properly integrate this button in our design solutions.
It was already 2006 when Yahoo published their Design Pattern Library. Nowadays this source is no longer available, but back in the day it was an interesting tool to study how Yahoo provided solutions to their design problems.
There are hundreds of design pattern libraries available that can help us in our jobs in user experience design.
Essential design pattern elements
A design pattern has four cornerstone elements:
- Name: Identifies the pattern, describes in few words a design problem alongside its solutions and consequences. Giving a name to a design pattern increases the design vocabulary, which improves not only documentation, but also communication between software development team members.
- Problem: Describes when we can use the pattern, explains the problem and its context.
- Solution: Describes the elements that constitute the design, its relations, responsibilities and collaborations. Solution does not describe a specific design or implementation, but it provides a template that can be used for many different solutions.
- Consequences: These are the results, and also the advantages and inconveniences of applying the pattern.
What do design patterns aim to achieve?
It is vital to understand that design patterns were not born to impose some alternatives over others or to delete the creativity inherent in the design process itself.
The objective of Design patterns is to provide catalogues of reusable elements in software system designs and avoid repeating the search of solutions to problems which are already known and have been successfully fixed.
This is why we should address that, in some cases, we might find ourselves in a situation where the pattern does not apply, and trying to force its use would be a mistake.
This article is a translation of the following one published on our corporate website: