SlideShare a Scribd company logo
DESIGN PATTERN
DESIGN PATTERN
• A design pattern is “a generalized solution to a commonly occurring
problem.”
• A design pattern is away of organizing a design that improves the
optimality of a design with respect to one or a small set of design
criteria, such as qualities of service(QoS).
• A design pattern always has a focused purpose–which is to take one or
a small set of these QoS properties and optimize them at the expense
of the others. Each pattern optimizes some aspect of a system at the
cost of deoptimizing some other aspects. These constitute a set of pros
and cons.
BASIC STRUCTURE OF DESIGN PATTERNS
• Name: The name provides a “handle” or means to reference the
pattern.
• Purpose: The purpose provides the problem context and the QoS
aspects the pattern seeks to optimize. The purpose identifies the kinds
of problem contexts where the pattern might be particularly
appropriate.
• Solution: The solution is the pattern itself.
• Consequences: The consequences are the set of pros and cons of the
use of the pattern.
NAME
• The pattern name brings us two things. First, it allows us to reference
the pattern in a clear, unambiguous way, with the details present, but
unstated.
• Secondly, it gives us a more abstract vocabulary to speak about our
designs.
• The statement “The system uses a Homogeneous Channel redundant
architecture with Cyclic Executive Concurrency distributed across a
set of processors with a Proxy Pattern” has a lot of information about
the overall structure of the system because we can discuss the
architecture in terms of these patterns.
PURPOSE
• The statement “The system uses a Homogeneous Channel redundant
architecture with Cyclic Executive Concurrency distributed across a
set of processors with a Proxy Pattern” has a lot of information about
the overall structure of the system because we can discuss the
architecture in terms of these patterns.
SOLUTION
• The solution specifies the structure and behavior of the pattern itself. It
identifies the elements of the pattern and their roles in the context of
the pattern.
• This pattern solution is integrated into your design in a process known
as pattern instantiation.
CONSEQUENCES
• The consequences are important because we always make trade offs
when we select one pattern over another.
• We must understand the pros and cons of the pattern to apply it
effectively.
• The pros and cons are usually couched in terms of improvement or
degradation of some design properties, as well as a possible
elaboration of problem contexts in which these consequences apply.
WHAT TO DO WHEN YOU’RE FACING DESIGN
PROBLEMS?
PATTERN HATCHING–LOCATING THE RIGHT
PATTERNS
• Familiarize yourself with the patterns: Before starting your design,
familiarize yourself with the patterns literature. Once you have increased
your vocabulary to include patterns likely to be relevant to your
application domain, you have more intellectual ammunition to face your
design challenges.
• Identify design criteria: In parallel with reading about potential design
alternatives, you must identify design criteria. This step identifies the
design optimizations that are important for this particular system in its
operational and development contexts.
• Rank design criteria: Not all optimizations are equally important.
For this reason, the design criteria must be ranked to enable good trade
off decisions to be made.
PATTERN HATCHING–LOCATING THE RIGHT
PATTERNS
• Identify potential design alternatives: This step finds patterns that
optimize the design criteria of importance at a cost that seems
reasonable. While it is possible to add a single pattern at a time in this
way and repeat the work flow, it is also common to consider a set of
compatible patterns together as a single design alternative.
• Evaluate the design alternatives: Using the trade study approach
suggested earlier, this step compares the design alternatives (consisting
of one or more design patterns) against each other on the basis of their
effectiveness against the design criteria, weighted with the relative
importance of each.
PATTERN HATCHING–LOCATING THE RIGHT
PATTERNS
• Select and apply design alternative: Once a design alternative is
selected, the patterns are usually added to the collaboration one at a
time, including verification of the efficacy of the solution.
• Verify design functionality: The collaboration of software elements
worked before applying the design patterns. This task ensures that it
still does.
• Verify design goals are met: Once the design functionality is verified,
we must also ensure that the optimization goals of the design decisions
result in the right trade offs. If we’ve optimized the code for memory
usage, the usage should be measured as the software runs.
PATTERN HATCHING–LOCATING THE RIGHT
PATTERNS
PATTERN MINING-ROLLING YOUR OWN
PATTERNS
• Creating your own pattern is
useful, especially when you have
a depth of experience to
understand the optimization
issues in a particular area, and
sufficient breadth to understand
the general properties of the
solutions enough to abstract them
in to a generalized solution.
• This is called pattern mining.
PATTERN INSTANTIATION–APPLYING
PATTERNS IN YOUR DESIGNS
• Pattern instantiation is the opposite of
pattern mining. It is applying the pattern to
a particular collaboration to gain the
benefits of the pattern.
• Patterns are normally applied to a
collaboration of software elements, such as
classes, types, functions, and/or variables.
• The application or instantiation of a pattern
in your design is a matter of identifying the
elements in your collaboration that fulfill
the pattern parameter roles.
AN EXAMPLE: DEBOUNCING PATTERN
• Abstract: Push buttons, toggle switches, and electromechanical relays are
input devices for digital systems that share a common problem–as metal
connections make contact, the metal deforms or “bounces”, producing
intermittent connections during switch open or closure. This pattern
addresses this concern by reducing the multiple signals into a single one
by waiting a period of time after the initial signal and then checking the
state.
• Problem: As the metal in input devices, used for embedded systems,
moves into contact, physical deformation occurs resulting in an
intermittent bouncing contact until the vibrations dampen down.
AN EXAMPLE: DEBOUNCING PATTERN
• Pattern Structure: The basic solution is to accept the initial event, wait
for the vibrations to dampen out, and then sample the data source for its
state.
AN EXAMPLE: DEBOUNCING PATTERN
• Collaboration Roles:
1. Application Client: This element is the ultimate recipient of the debounced
event. Its operation deviceEventReceive() is only activated when the event is
real (i.e., results in a changed device state).
2. Bouncing Device: The Bouncing Device represents the hardware for the device
itself. The most common implementation of this device is completely in
hardware.
3. Debouncer: The Debouncer is the software element that processes the
incoming event, debounces it, and makes sure that it represents an actual device
state change.
4. Debouncing Timer: This timer provides an on busy wait via its delay() service.
This is often done with an OS call but might be done with specialty timer
hardware as well.
AN EXAMPLE: DEBOUNCING PATTERN
• Consequences: This pattern is not necessary for hardware that debounces before
announcing events. In my experience, however, it often falls on the software to
perform this task. This is a simple pattern that performs the debouncing so that the
application need only concern itself with true events resulting from a change in
device state.
• Implementation Strategies: It is common for the device to use an interrupt
vector to contact its client. It is common for the Bouncing Device to be entirely
implemented in hardware so that when the event occurs, a hardware interrupt is
created, and the device state must be verified by reading a memory location or
portaddress. When the event interface is via an interrupt, the address of the
DeviceClient::eventReceive() operation must be installed in the proper location in
the interrupt vector table when the DeviceClient is initiated.
AN EXAMPLE: DEBOUNCING PATTERN
EXAMPLE:

More Related Content

PPTX
PPT
FALLSEM2025-26_ISWE304L_TH_VL2025260102786_2025-07-10_Reference-Material-II.ppt
PPTX
Patterns
PPTX
Design patterns software re engineering lect 10
PPTX
Ece engineering embedded ppt -unit 2.pptx
PPTX
System design process.pptx
DOCX
Designing and documenting software architecture unit 5
PPTX
ppt2.pptx
FALLSEM2025-26_ISWE304L_TH_VL2025260102786_2025-07-10_Reference-Material-II.ppt
Patterns
Design patterns software re engineering lect 10
Ece engineering embedded ppt -unit 2.pptx
System design process.pptx
Designing and documenting software architecture unit 5
ppt2.pptx

Similar to DESIGN PATTERN.pptx (20)

PPTX
Models of Operational research, Advantages & disadvantages of Operational res...
PPTX
Good PracticesFor RequirementEngineering.pptx
PPT
Bdd with m spec
PPTX
Software Design Concepts
PPTX
Generic Software Process Models
PPT
Test Driven Development
PPT
Requirement analysis and specification, software engineering
PPT
UNIT-4design-concepts-se-pressman-ppt.PPT
PPTX
Development Guideline
PPT
Pawan111
PPT
Unified modeling language basics and slides
PPT
Chapter 6 design
PPT
Requirements analysis lecture
PPTX
'A critique of testing' UK TMF forum January 2015
PPTX
Designer engineering on the Data Science student
PPTX
Aspect Oriented Programming - AOP/AOSD
PPSX
Process model rup
PPT
software Engineering process
DOCX
Design Principlesfrom Don Norman’s Design of Everyday Thing.docx
Models of Operational research, Advantages & disadvantages of Operational res...
Good PracticesFor RequirementEngineering.pptx
Bdd with m spec
Software Design Concepts
Generic Software Process Models
Test Driven Development
Requirement analysis and specification, software engineering
UNIT-4design-concepts-se-pressman-ppt.PPT
Development Guideline
Pawan111
Unified modeling language basics and slides
Chapter 6 design
Requirements analysis lecture
'A critique of testing' UK TMF forum January 2015
Designer engineering on the Data Science student
Aspect Oriented Programming - AOP/AOSD
Process model rup
software Engineering process
Design Principlesfrom Don Norman’s Design of Everyday Thing.docx

More from LECO9 (20)

PPT
C Programming Intro.ppt
PPTX
Embedded Systems.pptx
PPTX
Basic Electronics.pptx
PPTX
Intro to Microcontroller.pptx
PPTX
PIC_Intro.pptx
PPTX
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
PPTX
STACKS AND QUEUES.pptx
PPTX
UNIONS IN C.pptx
PPTX
Processes, Threads.pptx
PPTX
OPERATORS IN C.pptx
PPTX
DATA STRUCTURES AND LINKED LISTS IN C.pptx
PPTX
FUNCTIONS IN C.pptx
PPTX
INTER PROCESS COMMUNICATION (IPC).pptx
PPTX
cprogramming Structures.pptx
PPTX
POINTERS.pptx
PPTX
DYNAMIC MEMORY ALLOCATION.pptx
PPTX
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
PPTX
cprogramming strings.pptx
PPTX
C-Programming Control statements.pptx
PPTX
C-Programming Function pointers.pptx
C Programming Intro.ppt
Embedded Systems.pptx
Basic Electronics.pptx
Intro to Microcontroller.pptx
PIC_Intro.pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
STACKS AND QUEUES.pptx
UNIONS IN C.pptx
Processes, Threads.pptx
OPERATORS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptx
FUNCTIONS IN C.pptx
INTER PROCESS COMMUNICATION (IPC).pptx
cprogramming Structures.pptx
POINTERS.pptx
DYNAMIC MEMORY ALLOCATION.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
cprogramming strings.pptx
C-Programming Control statements.pptx
C-Programming Function pointers.pptx

Recently uploaded (20)

DOCX
573137875-Attendance-Management-System-original
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Fundamentals of Mechanical Engineering.pptx
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPT
introduction to datamining and warehousing
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
737-MAX_SRG.pdf student reference guides
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Geodesy 1.pptx...............................................
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
573137875-Attendance-Management-System-original
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Safety Seminar civil to be ensured for safe working.
Fundamentals of Mechanical Engineering.pptx
Fundamentals of safety and accident prevention -final (1).pptx
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
introduction to datamining and warehousing
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
737-MAX_SRG.pdf student reference guides
Foundation to blockchain - A guide to Blockchain Tech
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Geodesy 1.pptx...............................................
Categorization of Factors Affecting Classification Algorithms Selection
R24 SURVEYING LAB MANUAL for civil enggi
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf

DESIGN PATTERN.pptx

  • 2. DESIGN PATTERN • A design pattern is “a generalized solution to a commonly occurring problem.” • A design pattern is away of organizing a design that improves the optimality of a design with respect to one or a small set of design criteria, such as qualities of service(QoS). • A design pattern always has a focused purpose–which is to take one or a small set of these QoS properties and optimize them at the expense of the others. Each pattern optimizes some aspect of a system at the cost of deoptimizing some other aspects. These constitute a set of pros and cons.
  • 3. BASIC STRUCTURE OF DESIGN PATTERNS • Name: The name provides a “handle” or means to reference the pattern. • Purpose: The purpose provides the problem context and the QoS aspects the pattern seeks to optimize. The purpose identifies the kinds of problem contexts where the pattern might be particularly appropriate. • Solution: The solution is the pattern itself. • Consequences: The consequences are the set of pros and cons of the use of the pattern.
  • 4. NAME • The pattern name brings us two things. First, it allows us to reference the pattern in a clear, unambiguous way, with the details present, but unstated. • Secondly, it gives us a more abstract vocabulary to speak about our designs. • The statement “The system uses a Homogeneous Channel redundant architecture with Cyclic Executive Concurrency distributed across a set of processors with a Proxy Pattern” has a lot of information about the overall structure of the system because we can discuss the architecture in terms of these patterns.
  • 5. PURPOSE • The statement “The system uses a Homogeneous Channel redundant architecture with Cyclic Executive Concurrency distributed across a set of processors with a Proxy Pattern” has a lot of information about the overall structure of the system because we can discuss the architecture in terms of these patterns. SOLUTION • The solution specifies the structure and behavior of the pattern itself. It identifies the elements of the pattern and their roles in the context of the pattern. • This pattern solution is integrated into your design in a process known as pattern instantiation.
  • 6. CONSEQUENCES • The consequences are important because we always make trade offs when we select one pattern over another. • We must understand the pros and cons of the pattern to apply it effectively. • The pros and cons are usually couched in terms of improvement or degradation of some design properties, as well as a possible elaboration of problem contexts in which these consequences apply.
  • 7. WHAT TO DO WHEN YOU’RE FACING DESIGN PROBLEMS?
  • 8. PATTERN HATCHING–LOCATING THE RIGHT PATTERNS • Familiarize yourself with the patterns: Before starting your design, familiarize yourself with the patterns literature. Once you have increased your vocabulary to include patterns likely to be relevant to your application domain, you have more intellectual ammunition to face your design challenges. • Identify design criteria: In parallel with reading about potential design alternatives, you must identify design criteria. This step identifies the design optimizations that are important for this particular system in its operational and development contexts. • Rank design criteria: Not all optimizations are equally important. For this reason, the design criteria must be ranked to enable good trade off decisions to be made.
  • 9. PATTERN HATCHING–LOCATING THE RIGHT PATTERNS • Identify potential design alternatives: This step finds patterns that optimize the design criteria of importance at a cost that seems reasonable. While it is possible to add a single pattern at a time in this way and repeat the work flow, it is also common to consider a set of compatible patterns together as a single design alternative. • Evaluate the design alternatives: Using the trade study approach suggested earlier, this step compares the design alternatives (consisting of one or more design patterns) against each other on the basis of their effectiveness against the design criteria, weighted with the relative importance of each.
  • 10. PATTERN HATCHING–LOCATING THE RIGHT PATTERNS • Select and apply design alternative: Once a design alternative is selected, the patterns are usually added to the collaboration one at a time, including verification of the efficacy of the solution. • Verify design functionality: The collaboration of software elements worked before applying the design patterns. This task ensures that it still does. • Verify design goals are met: Once the design functionality is verified, we must also ensure that the optimization goals of the design decisions result in the right trade offs. If we’ve optimized the code for memory usage, the usage should be measured as the software runs.
  • 12. PATTERN MINING-ROLLING YOUR OWN PATTERNS • Creating your own pattern is useful, especially when you have a depth of experience to understand the optimization issues in a particular area, and sufficient breadth to understand the general properties of the solutions enough to abstract them in to a generalized solution. • This is called pattern mining.
  • 13. PATTERN INSTANTIATION–APPLYING PATTERNS IN YOUR DESIGNS • Pattern instantiation is the opposite of pattern mining. It is applying the pattern to a particular collaboration to gain the benefits of the pattern. • Patterns are normally applied to a collaboration of software elements, such as classes, types, functions, and/or variables. • The application or instantiation of a pattern in your design is a matter of identifying the elements in your collaboration that fulfill the pattern parameter roles.
  • 14. AN EXAMPLE: DEBOUNCING PATTERN • Abstract: Push buttons, toggle switches, and electromechanical relays are input devices for digital systems that share a common problem–as metal connections make contact, the metal deforms or “bounces”, producing intermittent connections during switch open or closure. This pattern addresses this concern by reducing the multiple signals into a single one by waiting a period of time after the initial signal and then checking the state. • Problem: As the metal in input devices, used for embedded systems, moves into contact, physical deformation occurs resulting in an intermittent bouncing contact until the vibrations dampen down.
  • 15. AN EXAMPLE: DEBOUNCING PATTERN • Pattern Structure: The basic solution is to accept the initial event, wait for the vibrations to dampen out, and then sample the data source for its state.
  • 16. AN EXAMPLE: DEBOUNCING PATTERN • Collaboration Roles: 1. Application Client: This element is the ultimate recipient of the debounced event. Its operation deviceEventReceive() is only activated when the event is real (i.e., results in a changed device state). 2. Bouncing Device: The Bouncing Device represents the hardware for the device itself. The most common implementation of this device is completely in hardware. 3. Debouncer: The Debouncer is the software element that processes the incoming event, debounces it, and makes sure that it represents an actual device state change. 4. Debouncing Timer: This timer provides an on busy wait via its delay() service. This is often done with an OS call but might be done with specialty timer hardware as well.
  • 17. AN EXAMPLE: DEBOUNCING PATTERN • Consequences: This pattern is not necessary for hardware that debounces before announcing events. In my experience, however, it often falls on the software to perform this task. This is a simple pattern that performs the debouncing so that the application need only concern itself with true events resulting from a change in device state. • Implementation Strategies: It is common for the device to use an interrupt vector to contact its client. It is common for the Bouncing Device to be entirely implemented in hardware so that when the event occurs, a hardware interrupt is created, and the device state must be verified by reading a memory location or portaddress. When the event interface is via an interrupt, the address of the DeviceClient::eventReceive() operation must be installed in the proper location in the interrupt vector table when the DeviceClient is initiated.
  • 18. AN EXAMPLE: DEBOUNCING PATTERN EXAMPLE: