|
Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice. - Christopher Alexander For a shortened version of this document, visit the How to Write a Design Pattern FAQ at the Open Source Design Pattern Library site. How to Write a Good Design PatternWho Should Read This PageThis page gives background information on design patterns followed by guidelines and advice on writing helpful and effective patterns. It should be of interest to pattern authors, designers, and solution implementers, as well as anyone else interested in how patterns can contribute to the creation of well-crafted user interfaces. BackgroundWhen the central elements a design are abstracted from a particular solution and found to apply to a number of different solutions, we have a design pattern. While patterns in designs can be observed in many domains - from building architecture to object-oriented programming - the Open Source Design Pattern Library will initially focus on user experience patterns. Jennifer Tidwell describes these as "... structural and behavioral features that improve the 'habitability' of ... a user interface" (Tidwell, 2006). Following Tidwell's lead we will concentrate on how patterns relate to the user before considering other actors, such as the designer and the developer. Where do design patterns come from?A design pattern usually arises through a combination of creativity and discovery. They are sometimes seen to appear in the wild: a design is observed to have a wider application than its existing implementation, and someone records a description of it in general terms. In this case the pattern author may be considered to be the "first describer" rather than the original creator of the pattern. Christian Crumlish, the curator of Yahoo!'s design pattern library, considers himself to be more of a "pattern detective" than a pattern author. Sometimes a designer will create a completely new solution to a problem, describe it the general terms of a pattern, and receive credit as its author. In most cases however, designs and implementations will appear before a pattern is codified. This is a natural part of the process, since patterns are expected to be widely proven before their general acceptance. Design Pattern: A Formal DefinitionFormally, the term "design pattern" has been defined as a proven solution to a common problem within a specified context. Let's explore the details of this definition. Here, the word proven means "tested or tried", with implications of trustworthiness and reliability. A design pattern is proven through assessment by design experts, and demonstrations that effective designs can be derived from it. The word common in our definition simply means "recurring". Design patterns address problems that occur over and over. Specified context also deserves some explanation. The context description tells us where the pattern works and where it doesn't. When a designer seeks guidance from a design pattern, she must match the context of the problem she is trying to solve with the range of contexts in which the pattern has been shown to be useful. Elements of a Design PatternThe core elements of a design pattern are:
Context OutlineThe context outline describes the set of contexts in which the pattern is effective in responding to what the user needs. It may also indicate situations where the pattern is not a useful guide for the creation of designs. Problem StatementThe problem statement is an expression of what the user needs to do, perceive, or understand. SolutionThe solution statement explains how the user's problem is solved through a clear and understandable set of steps and perceptions. Solutions are often expressed through strong visual metaphors which help the user understand the process taking place. Illustrations and ExamplesA well-expressed design pattern will include examples of derived designs and implementations. From Patterns to ImplementationsHow specific are design patterns in the guidance they provide, and how do they relate to other expressions of design? If we view design as a set of refinements from the general to the particular, the information contained in a design pattern is at the most general and most abstract level. The design pattern author seeks to provide guidance to the solution of a general problem: one that may be encountered by users in a variety of situations. Let's consider the different levels at which a design can be expressed: Design PatternThe design pattern centres on the user's problem, and how it may occur in a variety of circumstances. The pattern provides a solution outline that employs well-established design principles. It is a model on which a designer can base solutions to specific cases of the problem. DesignThe designer makes design choices within the guidelines set by the design pattern. These are influenced by information that brings specificity to the problem. There will be personas that describe the user's likely intentions and desires as well as use cases that describe the user's objectives. All these serve to limit the scope of the problem to the application context, which should always be compatible with the design pattern context. The design description is user-focused, centring on the user's behaviour in interaction with the service. SpecificationA specification is a precise description of the behaviour of the service in its interactions with the user. Once a specification has been set, there are no user-perceptible design choices left to be made. To put this another way, a specification carries sufficient design information that different implementations – by different implementers – are behaviourally indistinguishable to the user. ImplementationThe implementations of a pattern are the working instantiations of designs based on the pattern. Writing Up A Design Pattern for the OSDPLIn writing up a design pattern for the Open Source Design Pattern Library, you will want to capture all the essential elements of the pattern as well providing your readers with enough background information for them to use it effectively. The pattern submission process of the OSDPL makes this fairly simple. It presents an input form with tabbed sections that cover both the pattern description and guidelines for its use under the following headings: 1. PropertiesIn the Properties section, enter the title of your pattern. Try to choose a title that is descriptive, but short enough to be used in conversation. This makes it easy for people to use the pattern name to refer to its functionality. You can also enter tags or keywords that help classify your pattern for searches. 2. ProblemHere you provide a brief description of the problem from the user's perspective. For example:
Note how this statement reflects the user's situation, and frames the context for solution.
3. SolutionThe solution section captures details of how the solution can be effected, as well as further clarifying scope and context. Solution DescriptionMake a brief statement of the solution in language that could be understood by the user. If a particular visual metaphor is to be used, describe it here. Solution Image SourcesUser interface patterns can often be best expressed with an image or set of images that show what the user will understand as a solution to the problem. Ideally, there will be a primary solution image that can be entered here. Use WhenHere is where the applicable contexts for the solution are described. As a pattern author, you need to explain to the reader the circumstances under which the solution will be most effective. HowHere you must explain how the interaction design should be structured to best represent the pattern. This section may include a discussion of design choices and trade-offs as well. RationaleThe rationale section is where you explain why this pattern works. List any applicable design principles, and reference published research or experimental results that justify the use of the pattern. In writing this section you should ask yourself, "what are the advantages of using this pattern?". 4. ExamplesIn this section you provide references to any examples that will help the reader in understanding the pattern, how it is used elsewhere, and how it may be used in future designs. Here you can insert URLs, upload images, and enter text descriptions. 5. AccessibilityAccessibility is a critical dimension of usability. Address any accessibility concerns in this section, and explain to the reader how to overcome any restrictions or limitations. 6. RelationshipsPublished patterns rarely exist in isolation. There are often related patterns in other collections, as well as significant implementations of patterns. Enter the URLs of sites to which your pattern bears a relationship. If there is a Fluid Project component based on your pattern, enter a reference to the component description. Guidelines for Pattern AuthorsWriting a pattern requires careful balancing between generality and specificity. Your pattern should be general enough to cover the widest possible area of application, and yet sufficiently specific to ensure that all its inherent design principles are carried through to implementations. Here are some things to keep in mind as you write:
ExampleA Pattern for a Progress IndicatorWe're not going to actually write a pattern for a progress indicator, we're just going to describe some of the things that should be considered in creating a good one. Problem: The user needs to be made aware that a process is taking place, and progress is being made. Context: A process has begun. It will take sufficient time that the user would like to know that progress is being made, at what rate, and when it will complete. Solution In crafting a solution model, the author should think of questions that give insight into the user's perceptions, and the scope and context of the user's situation. Here are some sample questions for consideration:
The pattern author must decide which of these questions is relevant to the pattern, and provide provide meaningful responses. These may simply offer choices to the designer, given the actual design objectives the designer faces. In the full exposition of the pattern the author may include any material that may assist the reader, such as:
A Final NoteIt all comes down to best practices. If a pattern conveys best practice in a way that is useful to the designer, and does it in a way that contributes to many solutions, then it is a success. |
On this Page
|