0% found this document useful (0 votes)
28 views8 pages

Design Patterns: What and How

Design patterns are solutions to common software design problems that arise during software development. They provide reusable solutions that balance high cohesion and low coupling. Using design patterns improves communication between designers and promotes code reuse, which can lower production costs and save time. Common templates are used to document design patterns, describing their structure, participants, collaborations, and consequences to understand how to apply the pattern. Design patterns are especially useful for maintenance and code reuse by allowing patterns to be shared and reused multiple times.

Uploaded by

Clevin Ck
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views8 pages

Design Patterns: What and How

Design patterns are solutions to common software design problems that arise during software development. They provide reusable solutions that balance high cohesion and low coupling. Using design patterns improves communication between designers and promotes code reuse, which can lower production costs and save time. Common templates are used to document design patterns, describing their structure, participants, collaborations, and consequences to understand how to apply the pattern. Design patterns are especially useful for maintenance and code reuse by allowing patterns to be shared and reused multiple times.

Uploaded by

Clevin Ck
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Design Patterns

What and How

By

Mehwish Kayani
Lecturer, PUCIT
Design Patterns
• Agenda
• Questions about Design Patterns
– What are they and where do they come from?
– What is the value and benefit of using Design
Patterns?
– What is the structure of a Design Pattern?
– Why are they used especially in the areas of
maintenance and code reuse?
• Answers of the asked Questions.
Design Patterns
• What are they…
Answer:
• Design Patterns are said to be time tested solutions of recurring design problems. It represents
both; the description of solution that you can read and an instance of solution to which you can
relate and solve the problem.
• … and where do they come from?
Answer:
• They are said to be derived from the work of ‘Christopher Alexandar’, a civil engineer who
wrote about his experience in solving design issues related to building towns and buildings.
Alexandar found that certain design constructs could be used time and time again to achieve a
desired affect. He documented and published his experience so that others could take benefit
of it. About 15 years back, software professionals started to follow the steps of Alexandar and
documented some software design constructs, which are now known as Design Patterns.
• To be Precise, four professionals: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides
put up their efforts into a book named ‘Design Patterns: Elements of reusable Object Oriented
Software’. It contained 23 patterns that were based on the experience of authors at that time.
Design Patterns
• What is the value and benefit of using Design
Patterns?
Answer
• Design Patterns have two major benefits
– They provide a way to solve problems related to software
development using a proven solution. And the solution
provides high cohesiveness with minimal coupling.
– Use of Design Patterns make the communication between
designers more efficient. Software professionals can
picture the high level design of the system immediately
when they refer to the name of patterns used to solve
certain problems discussing system design.
Design Patterns
• What is the structure of a Design Pattern?
Answer:
• Design Patterns documentation is highly
structured. They are documented in such a form
that identifies the information needed to
understand the software problem.
• There is no agreement between the designer’s
community to describe the Design Pattern
Template. Different authors prefer different
styles. Some prefers to be more expressive while
others prefer to be more precise.
The commonly used template for describing patterns:
Term Description
Pattern Name Describes the essence of pattern in a short but expressive name
Intent Describe what the pattern does
Applicability List the situations where the pattern is applicable
Motivation Provides an example of a problem and how that is solved
Structure Set of diagrams of the classes and objects that depict the pattern
Participants Describe the classes and objects that participate in the design
pattern and their responsibilities
Also Known as Other similar names of the specific pattern
Collaborations Describe how the participants collaborate to carry out the
responsibilities
Consequences Describe the forces that exist with the patterns the benefits,
trade-offs etc.
Related What Design Patterns are closely related to the specific pattern
Patterns
Code Sample The code fragments describing the implementation of the
Pattern.
Design Patterns
• Why are they used especially in the areas of
maintenance and code reuse?
Answer
• A pattern is designed once and is used many times.
Reuse of patterns potentially lowers production costs
and saves time by eliminating redesign. Reuse affords
higher software reliability and continuity to code
design.
• You can share patterns within a project, within a
company, or across many companies. The limitations
of a pattern are determined by the pattern design and
the intent of the pattern author.
Some Important Points
• Design Pattern: Design means a blue print or sketch of something;
so it can be defined as creation of something in mind where as
Pattern is a guideline of doing something that was in mind. So
jointly a Design Pattern means capturing design ideas as a pattern
to the problem.
• Patterns save your time at the design stage not at the
implementation stage, as they provide solutions to common design
problems. You learn the pattern and check when they are
applicable in your task.
• One reason of using patterns is they provide a common language
for software developers. No project should be considered as one
man’s project as things do grow unexpectedly. Patterns aid in the
establishment of more uniformity and ease of communication to
others through code.

You might also like