Chapter 12 - Pattern-Based Design
Chapter 12 - Pattern-Based Design
Overview
Design Patterns
Pattern Types
• Non-generative - describes a context and a problem but it does not provide any
clear-cut solution.
• Generative - used to “generate” an application or computer-based system whose
architecture enables it to adapt to change.
• Architectural - describe broad-based design problems that are solved using a
structural approach.
• Data - describe recurring data-oriented problems and the data modeling solutions
that can be used to solve them.
• Component (also referred to as design patterns) - address problems associated with
the development of subsystems and components, the manner in which they
communicate with one another, and their placement within a larger architecture,
• Interface - describe common user interface problems and their solution with a
system of forces that includes the specific characteristics of end-users.
• WebApp - address a problem set that is encountered when building WebApps and
often incorporates many of the other patterns categories just mentioned.
• Creational - focus on the “creation, composition, and representation of objects.
• Structural - focus on problems and solutions associated with how classes and
objects are organized and integrated to build a larger structure.
• Behavioral - address problems associated with the assignment of responsibility
between objects and the manner in which communication is effected between
objects.
Frameworks
• Used to complete the design when design patterns are not detailed enough
• Implementation-specific skeletal infrastructure containing plug points (hooks or slots)
that enable it to be adapted to a specific problem domain
• Plug points allow developers to integrate problem specific classes or functionality
within the skeleton
• In object-oriented design a framework would be a set of cooperating classes
• Name
• Intent
• Aliases
• Motivation
• Applicability
• Structure
• Participants
• Collaborators
• Consequences
• Related patterns
Thinking in Patterns
1. Be sure you understand the big picture (context in which the software will reside)
2. Extract the patterns that are present at that level of abstraction in the big picture.
3. Begin your design with ‘big picture’ patterns that establish a context or skeleton for
further design work.
4. “Work inward from the context” looking for patterns at lower levels of abstraction that
contribute to the design solution.
5. Repeat steps 1 to 4 until the complete design is fleshed out.
6. Refine the design by adapting each pattern to the specifics of the software you’re
trying to build.
Design Tasks
• Helps to categorize and organize candidate patterns from multiple patern languages
and repositories
• Table rows are labeled with abbreviated problem statements subdivided by the
categories data/content, architecture, component-level, user interface issues
• Columns are labeled with pattern types (e.g. database, application, implementation,
infrastructure)
• Candidate pattern names are entered the table cells preferably using a hyperlink or
URL for the pattern
Common Mistakes
• Not spending enough time understanding the problem which causes the selection of
an inappropriate pattern
• Refusing to recognize that a wrong pattern has been selected and trying to force fit
the pattern to the problem
• Applying a pattern too literally and not making the required adaptations to the current
problem space
Architectural Patterns
• Provide you with a proven solution that addresses one or more subproblems
extracted from the requirements model
• Many time they focus on a functional element of the system
• Top-level navigation
• Card stack
• Fill-in-the-blanks
• Sortable table
• Bread crumbs
• Edit-in-place
• Simple search
• Wizard
• Shopping cart
• Progress indicator
WebApp Design Pattern Categories
• Design focus – identifies the aspect of the design model relevant to problem
o Information architecture patterns – relate to overall structure of information space
and ways in which users will interact with information
o Navigation patterns – define navigation link structures (e.g. hierarchies, rings,
tours)
o Interaction patterns – contribute to the design of the user interface
o Presentation patterns – assist in the presentation of the content via the user
interface
o Functional patterns – define workflows, behaviors, processing, communications,
and other WebApp algorithmic elements
• Granularity – identifies level of abstraction being considered
o Architectural patterns – define the overall WebApp structure and indicate
relationships among components or elements
o Design patterns – address relationships among page elements or mechanisms
for affecting component to component communication
o Component patterns – focuses on relationships among individual WebApp
elements (e.g. interaction elements, navigation items, functional elements)