SlideShare a Scribd company logo
1 of 18
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

Similar to DESIGN PATTERN.pptx

Generic Software Process Models
Generic Software Process ModelsGeneric Software Process Models
Generic Software Process ModelsEducation Front
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentnikhil sreeni
 
Requirement analysis and specification, software engineering
Requirement analysis and specification, software engineeringRequirement analysis and specification, software engineering
Requirement analysis and specification, software engineeringRupesh Vaishnav
 
UNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPTUNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPTmalathijanapati1
 
Unified modeling language basics and slides
Unified modeling language basics and slidesUnified modeling language basics and slides
Unified modeling language basics and slidesvenkatasubramanianSr5
 
'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 Georgina Tilby
 
Aspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSDAspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSDCan R. PAHALI
 
Process model rup
Process model rupProcess model rup
Process model rupAryan Ajmer
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering processRaheel Aslam
 
Design Principlesfrom Don Norman’s Design of Everyday Thing.docx
Design Principlesfrom Don Norman’s Design of Everyday Thing.docxDesign Principlesfrom Don Norman’s Design of Everyday Thing.docx
Design Principlesfrom Don Norman’s Design of Everyday Thing.docxtheodorelove43763
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptRushikeshChikane1
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptRushikeshChikane2
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxKarthigaiSelviS3
 

Similar to DESIGN PATTERN.pptx (20)

Software Design Concepts
Software Design ConceptsSoftware Design Concepts
Software Design Concepts
 
Generic Software Process Models
Generic Software Process ModelsGeneric Software Process Models
Generic Software Process Models
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Requirement analysis and specification, software engineering
Requirement analysis and specification, software engineeringRequirement analysis and specification, software engineering
Requirement analysis and specification, software engineering
 
UNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPTUNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPT
 
Development Guideline
Development GuidelineDevelopment Guideline
Development Guideline
 
Pawan111
Pawan111Pawan111
Pawan111
 
Unified modeling language basics and slides
Unified modeling language basics and slidesUnified modeling language basics and slides
Unified modeling language basics and slides
 
Chapter 6 design
Chapter 6 designChapter 6 design
Chapter 6 design
 
Requirements analysis lecture
Requirements analysis lectureRequirements analysis lecture
Requirements analysis lecture
 
'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015
 
Aspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSDAspect Oriented Programming - AOP/AOSD
Aspect Oriented Programming - AOP/AOSD
 
Process model rup
Process model rupProcess model rup
Process model rup
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
 
Design Principlesfrom Don Norman’s Design of Everyday Thing.docx
Design Principlesfrom Don Norman’s Design of Everyday Thing.docxDesign Principlesfrom Don Norman’s Design of Everyday Thing.docx
Design Principlesfrom Don Norman’s Design of Everyday Thing.docx
 
module 1.pptx
module 1.pptxmodule 1.pptx
module 1.pptx
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
 
SW Project Process.pptx
SW Project Process.pptxSW Project Process.pptx
SW Project Process.pptx
 

More from LECO9

C Programming Intro.ppt
C Programming Intro.pptC Programming Intro.ppt
C Programming Intro.pptLECO9
 
Embedded Systems.pptx
Embedded Systems.pptxEmbedded Systems.pptx
Embedded Systems.pptxLECO9
 
Basic Electronics.pptx
Basic Electronics.pptxBasic Electronics.pptx
Basic Electronics.pptxLECO9
 
Intro to Microcontroller.pptx
Intro to Microcontroller.pptxIntro to Microcontroller.pptx
Intro to Microcontroller.pptxLECO9
 
PIC_Intro.pptx
PIC_Intro.pptxPIC_Intro.pptx
PIC_Intro.pptxLECO9
 
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxDATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxLECO9
 
STACKS AND QUEUES.pptx
STACKS AND QUEUES.pptxSTACKS AND QUEUES.pptx
STACKS AND QUEUES.pptxLECO9
 
UNIONS IN C.pptx
UNIONS IN C.pptxUNIONS IN C.pptx
UNIONS IN C.pptxLECO9
 
Processes, Threads.pptx
Processes, Threads.pptxProcesses, Threads.pptx
Processes, Threads.pptxLECO9
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptxLECO9
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxDATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxLECO9
 
FUNCTIONS IN C.pptx
FUNCTIONS IN C.pptxFUNCTIONS IN C.pptx
FUNCTIONS IN C.pptxLECO9
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxLECO9
 
cprogramming Structures.pptx
cprogramming Structures.pptxcprogramming Structures.pptx
cprogramming Structures.pptxLECO9
 
POINTERS.pptx
POINTERS.pptxPOINTERS.pptx
POINTERS.pptxLECO9
 
DYNAMIC MEMORY ALLOCATION.pptx
DYNAMIC MEMORY ALLOCATION.pptxDYNAMIC MEMORY ALLOCATION.pptx
DYNAMIC MEMORY ALLOCATION.pptxLECO9
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptxLECO9
 
cprogramming strings.pptx
cprogramming strings.pptxcprogramming strings.pptx
cprogramming strings.pptxLECO9
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptxLECO9
 
C-Programming Function pointers.pptx
C-Programming  Function pointers.pptxC-Programming  Function pointers.pptx
C-Programming Function pointers.pptxLECO9
 

More from LECO9 (20)

C Programming Intro.ppt
C Programming Intro.pptC Programming Intro.ppt
C Programming Intro.ppt
 
Embedded Systems.pptx
Embedded Systems.pptxEmbedded Systems.pptx
Embedded Systems.pptx
 
Basic Electronics.pptx
Basic Electronics.pptxBasic Electronics.pptx
Basic Electronics.pptx
 
Intro to Microcontroller.pptx
Intro to Microcontroller.pptxIntro to Microcontroller.pptx
Intro to Microcontroller.pptx
 
PIC_Intro.pptx
PIC_Intro.pptxPIC_Intro.pptx
PIC_Intro.pptx
 
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptxDATATYPES,KEYWORDS,FORMATSPECS[1].pptx
DATATYPES,KEYWORDS,FORMATSPECS[1].pptx
 
STACKS AND QUEUES.pptx
STACKS AND QUEUES.pptxSTACKS AND QUEUES.pptx
STACKS AND QUEUES.pptx
 
UNIONS IN C.pptx
UNIONS IN C.pptxUNIONS IN C.pptx
UNIONS IN C.pptx
 
Processes, Threads.pptx
Processes, Threads.pptxProcesses, Threads.pptx
Processes, Threads.pptx
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxDATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptx
 
FUNCTIONS IN C.pptx
FUNCTIONS IN C.pptxFUNCTIONS IN C.pptx
FUNCTIONS IN C.pptx
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
 
cprogramming Structures.pptx
cprogramming Structures.pptxcprogramming Structures.pptx
cprogramming Structures.pptx
 
POINTERS.pptx
POINTERS.pptxPOINTERS.pptx
POINTERS.pptx
 
DYNAMIC MEMORY ALLOCATION.pptx
DYNAMIC MEMORY ALLOCATION.pptxDYNAMIC MEMORY ALLOCATION.pptx
DYNAMIC MEMORY ALLOCATION.pptx
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
 
cprogramming strings.pptx
cprogramming strings.pptxcprogramming strings.pptx
cprogramming strings.pptx
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptx
 
C-Programming Function pointers.pptx
C-Programming  Function pointers.pptxC-Programming  Function pointers.pptx
C-Programming Function pointers.pptx
 

Recently uploaded

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 

Recently uploaded (20)

young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 

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: