# Interaction design pattern

Interaction design patterns are design patterns applied in the context human–computer interaction, describing common designs for graphical user interfaces.
A design pattern is a formal way of documenting a solution to a common design problem. The idea was introduced by the architect Christopher Alexander for use in urban planning and building architecture and has been adapted for various other disciplines, including teaching and pedagogy, organization development and process, and software architecture and design.
Thus, interaction design patterns are a way to describe solutions to common usability or accessibility problems in a specific context. They document interaction models that make it easier for users to understand an interface and accomplish their tasks.

## History

Patterns originated as an architectural concept by Christopher Alexander. Patterns are ways to describe best practices, explain good designs, and capture experience so that other people can reuse these solutions.
Design patterns in computer science are used by software engineers during the actual design process and when communicating designs to others. Design patterns gained popularity in computer science after the book Design Patterns: Elements of Reusable Object-Oriented Software was published. Since then a pattern community has emerged that specifies patterns for problem domains including architectural styles and object-oriented frameworks. The Pattern Languages of Programming Conference (annual, 1994—) proceedings includes many examples of domain-specific patterns.
Applying a pattern language approach to interaction design was first suggested in Norman and Draper's book User Centered System Design (1986). The Apple Computer's Macintosh Human Interface Guidelines also quotes Christopher Alexander's works in its recommended reading.

## Libraries

Alexander envisioned a pattern language as a structured system in which the semantic relationships between the patterns create a whole that is greater than the sum of its parts, much like the way that grammatical relationships between words make language meaningful. While some collections of patterns attempt to create the structural relationships needed to form a language, many others are simply an assemblage of patterns (and thus are more appropriately termed pattern libraries.)

## Mobile interaction pattern libraries

The popularity of mobile devices such as smartphones and tablets usher in a need for a library of mobile interaction design patterns.
This need is driven by:
* Differences in user behavior and interaction on mobile devices such as swipe and tap gestures, vis-a-vis interaction on a Desktop GUI, which is mouse-driven
* Differences in physical attributes between a mobile and a desktop device e.g. screen size, touch screen, etc.
* Design guidelines recommended by mobile OS e.g. iOS, Android

## Elements

For patterns to be helpful to the designers and developers who will make use of them, they need to be findable and readable.

### Common elements

Though pattern descriptions vary somewhat, many pattern libraries include some common elements:
* Pattern Name: Choosing a clear and descriptive name helps people find the pattern and encourages clear communication between team members during design discussions.
* Pattern Description: Because short names like "one-window drilldown" are sometimes not sufficient to describe the pattern, a few additional lines of explanation (or a canonical screenshot) will help explain how the pattern works.
* Problem Statement: Written in user-centered language, this communicates what the user wants to achieve or what the challenge is to the end-user.
* Use When: "Context of use" is a critical component of the design pattern. This element helps people understand situations when the design pattern applies (and when it does not.)
* Solution: The solution should explain "how" to solve the problem, and may include prescriptive checklists, screenshots, or even short videos demonstrating the pattern in action.
* Rationale: Providing reasons "why" the pattern works will reinforce the solution, though time-pressed developers may prefer to ignore this explanation.
* Examples: Each example shows how the pattern has been successfully applied This is often accompanied by a screenshot and a short description.
* Comments: Including a place for team members to discuss the use of the pattern helps maintain an active resource and keeps the team engaged.

### Optional elements

Pattern libraries can also include optional elements, depending on the needs of the team using them. These may include:
* Implementation Specifications: A style guide with detailed information about font sizes, pixel dimensions, colors, and wording for messages and labels can be helpful for developers.
* Usability Research: Any supporting research from usability tests or other user feedback should be captured. This can also include feedback from developers, customer service, or the sales team.
* Related Patterns: The pattern library may include similar patterns, or it may be organized into a hierarchy of parent and child patterns.
* Similar Approaches: Since there are likely to be many possible solutions to this problem, teams may want a place to capture similar alternatives.
* Source Code: If the code is modular enough to be reused, then it can be included in the library as well.

## Reasons to use design patterns

Benefits of using interaction design patterns include:
* Teaching novices some best practices and common approaches
* Capturing collective wisdom of designers across many uses and scenarios
* Giving teams a common language, reducing misunderstandings that arise from the different vocabulary
* Reducing time and costs in the design and development lifecycle
* Making usable designs the "path of least resistance"
* Eliminate wasted time spent "reinventing the wheel"
* Ensuring users have a consistent and predictable experience within an application or service

## Advantages over design guidelines

Guidelines are generally more useful for describing requirements whereas patterns are useful tools for those who need to translate requirements into specific software solutions. Some people consider design guidelines as an instance of interaction design pattern as they are also common approach of capturing the experience in interaction design. However, interaction design patterns usually have the following advantages over design guidelines:
* Abstract guidelines, like the Eight Golden Rules of Interface Design by Shneiderman, do not suggest how to solve a problem like many interaction design pattern, and cannot be used for interdisciplinary communication. Furthermore, guidelines do not provide an explanation as to why a particular solution works.
* Concrete guidelines, like Macintosh Human Interface Guidelines, are too tailored to a specific interface, and therefore are not as effective when applied to other interfaces (especially non-Macintosh interfaces).
* Other problems with guidelines are that they tend to be too numerous which makes it difficult for designers to apply the right guidelines. Also guidelines assume an absolute validity while usually they can only be applied in a particular context. A result of that is also that guidelines often tend to conflict just because they lack describing a context.
Guidelines and patterns are not necessarily conflicting, and both can be used in conjunction to identify the problem and then create a valid solution.