SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
www.edureka.co/design-patterns
View Design Patterns course details at www.edureka.co/design-patterns
For Queries:
Post on Twitter @edurekaIN: #askEdureka
Post on Facebook /edurekaIN
For more details please contact us:
US : 1800 275 9730 (toll free)
INDIA : +91 88808 62004
Email us : webinars@edureka.co
Design Patterns : Solution to Software Design
Problems
Slide 2 www.edureka.co/design-patterns
At the end of this session, you will be able to:
Objectives
 Know what are Software Design Patterns
 Understand the need of Software Design Patterns
 Distribute Responsibility using Chain Of Responsibility Pattern
 Communicate among objects with Mediator Pattern
 Understand Observer Patterns
Slide 3 www.edureka.co/design-patterns
Software Design Patterns & Gang Of Four(GOF)
 Software design patterns describe relationship among classes to solve a general and repeatable design problem in a
specific context with proven solution
 Anyone who knows something about Software Design Patterns will certainly be aware of famous book “Elements of
Reusable Object-Oriented Software” written by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides
popularly knows as Gang Of Four(GOF)
This is the most popular book
written on Software Design
Patterns by Erich
Gamma, Richard Helm, Ralph
Johnson and John Vlissides,
known as Gang Of Four
Slide 4 www.edureka.co/design-patterns
Classification of Software Design Patterns
Software Design Patterns
Creational Design
Pattern
Factory Pattern
Object Pool Pattern
Singleton Pattern
Structural Design
Pattern
Adapter Pattern
Decorator Pattern
Composite Pattern
Behavioral Design Pattern
Chain of Responsibility
Pattern
Mediator Pattern
ObserverPattern
Concurrency Design Pattern
Reactor Pattern
Scheduler Pattern
Thread Pool Pattern
.
.
.
.
.
.
.
.
.
.
.
.
Slide 5 www.edureka.co/design-patterns
Importance of Design Patterns
 Just knowing a Programming Language is not enough to engineer a software application
 While building an application its important that we keep the future requirements and changes in mind
otherwise you will have to change the code that you had written earlier
 Building a large application is never easy, so its very important that you design it correctly and then start
coding the application
 Design Patterns provides efficient techniques to create a flexible application design
Slide 6Slide 6Slide 6 www.edureka.co/design-patterns
 Chain Of Responsibility pattern gives more than one object a chance to handle the request
 Sender of the request does not know which object in the chain will serve its request
 In Chain Of Responsibility pattern a chain of request handlers is maintained, a handler decides whether it can
handle the request or not, if not then it passes the request to next handler
Chain of Responsibility (COR)
Receiver 1 Receiver 2 Receiver 3
Request Request Request
Receiver N
Request
Reference to
Receiver 2
Reference to
Receiver 3
Chain of Receiver
Reference to
Receiver 4
Cannot
handle
Slide 7Slide 7Slide 7 www.edureka.co/design-patterns
1. Handler - defines an interface for handling requests
2. ConcreteHandler - handles the requests it is responsible for .If it can handle the request it does so, otherwise
it sends the request to its successor
3. Client - sends commands to the first object in the chain that may handle the command
Handler
+HandleRequest()
ConcreteHandler1
+HandleRequest()
ConcreteHandler2
+HandleRequest()
Client
Chain of Responsibility - UML Diagram
Slide 8Slide 8Slide 8 www.edureka.co/design-patterns
Problem Statement
 Customer support system is one of the implementation of this pattern, where users calls the help desk (L1 support)
and tell their problem
L1 Support L2 Support
Cannot handle
Problem
Statement
Resolved
Resolved
YES NO
YES NO
Request goes through multiple objects (handlers)
Slide 9Slide 9Slide 9 www.edureka.co/design-patterns
Solution
 Using Chain of responsibility simplifies the request object because it does not have to know the chain’s structure
and keep direct references to its members
 In this case, user simply interact with help desk and the request internally goes through multiple handlers
 User does not need to know about the different handlers
Slide 10Slide 10Slide 10 www.edureka.co/design-patterns
Implementing Chain of Responsibility
Client (user) will generate a
SupportRequest (a ticket)
All support levels will have to
inherit the support class and
implement the handleRequest()
Slide 11Slide 11Slide 11 www.edureka.co/design-patterns
Implementing Chain of Responsibility (Contd.)
Slide 12Slide 12Slide 12 www.edureka.co/design-patterns
Implementing Chain of Responsibility (Contd.)
Slide 13Slide 13Slide 13 www.edureka.co/design-patterns
Implementing Chain of Responsibility (Contd.)
Here we are creating chain of responsible
objects for handling the support request
according to user query
All the support requests will
first go to L1 support
Output
Slide 14Slide 14Slide 14 www.edureka.co/design-patterns
Other Uses Of Chain of Responsibility
One of the most important use of Chain Of Responsibility pattern is to implement filter mechanism
Here one filter process the request and then passes on to next filter in the chain, similarly next filter processes the
request and then passes onto next filter in chain
JavaEE API uses Chain Of Responsibility pattern to implement filter mechanism using the following doFilter() method
javax.servlet.Filter#doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
Request
Logging
Filter
Authentication
Filter
Servlet
JAX-WS also uses Chain Of Responsibility pattern to implement JWS Handler Framework, which allows
manipulation of SOAP messages
Slide 15Slide 15Slide 15 www.edureka.co/design-patterns
Mediator Pattern
 The mediator pattern promotes loose coupling of objects by removing the need for classes to communicate with
each other directly
 Instead, mediator objects are used to encapsulate and centralize the interactions between classes
 Mediator pattern simplifies communication in general when a
program contains large number of classes that interact
 Each class only needs to know how to pass messages to its
mediator, rather than to numerous colleagues
Slide 16Slide 16Slide 16 www.edureka.co/design-patterns
Mediator Pattern – UML Diagram
 Mediator - defines an interface for communicating with Colleague objects
 ConcreteMediator - knows the colleague classes and keep a reference to the colleague objects
 Colleague classes - keep a reference to its Mediator object
Mediator
ConcreteMediator ConcreteColleagueA ConcreteColleagueB
Colleague
Slide 17Slide 17Slide 17 www.edureka.co/design-patterns
Problem Statement
 Suppose you have to create a chat application where multiple users
can chat together
 Rather than each user sending the message directly to other users,
we can use mediator pattern to implement this design
Slide 18Slide 18Slide 18 www.edureka.co/design-patterns
Implementing Mediator Pattern
ChatMediator keeps the
reference of all the users
Slide 19Slide 19Slide 19 www.edureka.co/design-patterns
Implementing Mediator Pattern (Contd.)
A User doesn’t have any
reference to other users
Slide 20Slide 20Slide 20 www.edureka.co/design-patterns
Output
Implementing Mediator Pattern (Contd.)
Slide 21Slide 21Slide 21 www.edureka.co/design-patterns
ContactSelectorPanel
ContactDisplayPanel
ContactEditorPanel
1. All GUI applications consists of small components like
Windows, Panel etc.
2. Each Panel contains a group of GUI element
3. These panels have to co-ordinate among themselves
4. As in this application, whenever a contact is selected
from the drop down box, its details should be updated in
the ContactDisplayPanel and ContactEditorPanel
5. Rather then one panel having reference of all other
panels, we can use Mediator Pattern to simplify the
communication between panel objects
Implementing Mediator Pattern (Contd.)
Slide 22 www.edureka.co/design-patterns
Observer Pattern
Observer SubjectObserves
notify
Observer:
There is someone watching you
Slide 23 www.edureka.co/design-patterns
Reference : tutorialspoint.com
Observer Pattern
Slide 24 www.edureka.co/design-patterns
Conclusion
 Similarly there are other design patterns to solve majority of the problems that software designers encounter
during their day to day activities
 Design patterns compliments ones experience and helps them deliver wonderful and successful software designs
 They serve as common nomenclature or jargon that architects can easily communicate with others in software
industry
 Software design is no more an art. It’s a skill one can learn. And thanks to design patterns
Design Patterns : Solution to Software Design Problems

Weitere ähnliche Inhalte

Was ist angesagt?

Automation Using Selenium Webdriver
Automation Using Selenium WebdriverAutomation Using Selenium Webdriver
Automation Using Selenium WebdriverEdureka!
 
Working with Advanced Views in Android
Working with Advanced Views in AndroidWorking with Advanced Views in Android
Working with Advanced Views in AndroidEdureka!
 
Getting Started With AngularJS
Getting Started With AngularJSGetting Started With AngularJS
Getting Started With AngularJSEdureka!
 
Using Android 5.0 Lollipop
Using Android 5.0 LollipopUsing Android 5.0 Lollipop
Using Android 5.0 LollipopEdureka!
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperEdureka!
 
Webinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration Platform
Webinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration PlatformWebinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration Platform
Webinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration PlatformEdureka!
 
Implementing Web Services In Java
Implementing Web Services In JavaImplementing Web Services In Java
Implementing Web Services In JavaEdureka!
 
Learn How to Animate your Android App
Learn How to Animate your Android AppLearn How to Animate your Android App
Learn How to Animate your Android AppEdureka!
 
Webinar: DevOps - Redefining your IT Strategy
Webinar: DevOps - Redefining your IT StrategyWebinar: DevOps - Redefining your IT Strategy
Webinar: DevOps - Redefining your IT StrategyEdureka!
 
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web DevelopmentWebinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web DevelopmentEdureka!
 
Android development 1july
Android development 1julyAndroid development 1july
Android development 1julyEdureka!
 
Java/J2EE & SOA
Java/J2EE & SOA Java/J2EE & SOA
Java/J2EE & SOA Edureka!
 
Deep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript FrameworkDeep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript FrameworkEdureka!
 
Quality Assurance with Manual Testing
Quality Assurance with Manual TestingQuality Assurance with Manual Testing
Quality Assurance with Manual TestingEdureka!
 
What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...
What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...
What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...Edureka!
 
An overview of the architecture of electron.js
An overview of the architecture of electron.jsAn overview of the architecture of electron.js
An overview of the architecture of electron.jsMoon Technolabs Pvt. Ltd.
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentEdureka!
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJSEdureka!
 

Was ist angesagt? (20)

Automation Using Selenium Webdriver
Automation Using Selenium WebdriverAutomation Using Selenium Webdriver
Automation Using Selenium Webdriver
 
Working with Advanced Views in Android
Working with Advanced Views in AndroidWorking with Advanced Views in Android
Working with Advanced Views in Android
 
Getting Started With AngularJS
Getting Started With AngularJSGetting Started With AngularJS
Getting Started With AngularJS
 
Using Android 5.0 Lollipop
Using Android 5.0 LollipopUsing Android 5.0 Lollipop
Using Android 5.0 Lollipop
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js Developer
 
Webinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration Platform
Webinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration PlatformWebinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration Platform
Webinar: Microsoft SharePoint-The Ultimate Enterprise Collaboration Platform
 
Implementing Web Services In Java
Implementing Web Services In JavaImplementing Web Services In Java
Implementing Web Services In Java
 
Learn How to Animate your Android App
Learn How to Animate your Android AppLearn How to Animate your Android App
Learn How to Animate your Android App
 
Webinar: DevOps - Redefining your IT Strategy
Webinar: DevOps - Redefining your IT StrategyWebinar: DevOps - Redefining your IT Strategy
Webinar: DevOps - Redefining your IT Strategy
 
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web DevelopmentWebinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
 
Android development 1july
Android development 1julyAndroid development 1july
Android development 1july
 
Java/J2EE & SOA
Java/J2EE & SOA Java/J2EE & SOA
Java/J2EE & SOA
 
Deep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript FrameworkDeep Dive into AngularJS Javascript Framework
Deep Dive into AngularJS Javascript Framework
 
Quality Assurance with Manual Testing
Quality Assurance with Manual TestingQuality Assurance with Manual Testing
Quality Assurance with Manual Testing
 
Beyond The MVC
Beyond The MVCBeyond The MVC
Beyond The MVC
 
What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...
What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...
What Is Selenium | Selenium Tutorial For Beginner | Selenium Training | Selen...
 
An overview of the architecture of electron.js
An overview of the architecture of electron.jsAn overview of the architecture of electron.js
An overview of the architecture of electron.js
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJS
 
How to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step GuideHow to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step Guide
 

Andere mochten auch

Some Wicked Problems of Software Design.
Some Wicked Problems of Software Design.Some Wicked Problems of Software Design.
Some Wicked Problems of Software Design.Bjoern Hartmann
 
5 things one must know about spark!
5 things one must know about spark!5 things one must know about spark!
5 things one must know about spark!Edureka!
 
Software Architecture: Design Decisions
Software Architecture: Design DecisionsSoftware Architecture: Design Decisions
Software Architecture: Design DecisionsHenry Muccini
 
Epg design patterns
Epg design patternsEpg design patterns
Epg design patternsJavier Lasa
 
Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14koolkampus
 
Apache Storm
Apache StormApache Storm
Apache StormEdureka!
 
AngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW FrameworkAngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW FrameworkEdureka!
 
GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...João Paulo Rechi Vita
 
Agile 101
Agile 101Agile 101
Agile 101beLithe
 
Build reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQBuild reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQRobin Xiao
 
DevOps is Going to Replace SDLC! Learn Why?
DevOps is Going to Replace SDLC! Learn Why?DevOps is Going to Replace SDLC! Learn Why?
DevOps is Going to Replace SDLC! Learn Why?Edureka!
 
The Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's ClassThe Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's Classdesertturtle
 
Simplifying Big Data ETL with Talend
Simplifying Big Data ETL with TalendSimplifying Big Data ETL with Talend
Simplifying Big Data ETL with TalendEdureka!
 
Basic tutorial how to use slideshare
Basic tutorial how to use slideshareBasic tutorial how to use slideshare
Basic tutorial how to use slideshareCherrylin Ramos
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design PatternsAddy Osmani
 
Ch6-Software Engineering 9
Ch6-Software Engineering 9Ch6-Software Engineering 9
Ch6-Software Engineering 9Ian Sommerville
 
Stages of problem solving presentation
Stages of problem solving presentationStages of problem solving presentation
Stages of problem solving presentationbbaugh
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview QuestionsArc & Codementor
 

Andere mochten auch (20)

Some Wicked Problems of Software Design.
Some Wicked Problems of Software Design.Some Wicked Problems of Software Design.
Some Wicked Problems of Software Design.
 
5 things one must know about spark!
5 things one must know about spark!5 things one must know about spark!
5 things one must know about spark!
 
Software Architecture: Design Decisions
Software Architecture: Design DecisionsSoftware Architecture: Design Decisions
Software Architecture: Design Decisions
 
Epg design patterns
Epg design patternsEpg design patterns
Epg design patterns
 
Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14Design Issue(Reuse) in Software Engineering SE14
Design Issue(Reuse) in Software Engineering SE14
 
Ømq & Services @ Chartboost
Ømq & Services @ ChartboostØmq & Services @ Chartboost
Ømq & Services @ Chartboost
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Apache Storm
Apache StormApache Storm
Apache Storm
 
AngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW FrameworkAngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW Framework
 
GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...GSoC: How to get prepared and write a good proposal (or how to start contribu...
GSoC: How to get prepared and write a good proposal (or how to start contribu...
 
Agile 101
Agile 101Agile 101
Agile 101
 
Build reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQBuild reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQ
 
DevOps is Going to Replace SDLC! Learn Why?
DevOps is Going to Replace SDLC! Learn Why?DevOps is Going to Replace SDLC! Learn Why?
DevOps is Going to Replace SDLC! Learn Why?
 
The Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's ClassThe Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's Class
 
Simplifying Big Data ETL with Talend
Simplifying Big Data ETL with TalendSimplifying Big Data ETL with Talend
Simplifying Big Data ETL with Talend
 
Basic tutorial how to use slideshare
Basic tutorial how to use slideshareBasic tutorial how to use slideshare
Basic tutorial how to use slideshare
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design Patterns
 
Ch6-Software Engineering 9
Ch6-Software Engineering 9Ch6-Software Engineering 9
Ch6-Software Engineering 9
 
Stages of problem solving presentation
Stages of problem solving presentationStages of problem solving presentation
Stages of problem solving presentation
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 

Ähnlich wie Design Patterns : Solution to Software Design Problems

Webinar on Design Patterns titled 'Dive into Design Patterns'
Webinar on Design Patterns titled 'Dive into Design Patterns'Webinar on Design Patterns titled 'Dive into Design Patterns'
Webinar on Design Patterns titled 'Dive into Design Patterns'Edureka!
 
Webinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software DevelopmentWebinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software DevelopmentEdureka!
 
Modeling Object Oriented Applications by Using Dynamic Information for the I...
Modeling Object Oriented Applications by Using Dynamic  Information for the I...Modeling Object Oriented Applications by Using Dynamic  Information for the I...
Modeling Object Oriented Applications by Using Dynamic Information for the I...IOSR Journals
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
 
Software Engineering Past Papers Notes
Software Engineering Past Papers Notes Software Engineering Past Papers Notes
Software Engineering Past Papers Notes MuhammadTalha436
 
6. ch 5-understanding requirements
6. ch 5-understanding requirements6. ch 5-understanding requirements
6. ch 5-understanding requirementsDelowar hossain
 
Design pattern application
Design pattern applicationDesign pattern application
Design pattern applicationgayatri thakur
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementationthe_wumberlog
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz QuestionsGanesh Samarthyam
 
CIS 524 Effective Communication/tutorialrank.com
 CIS 524 Effective Communication/tutorialrank.com CIS 524 Effective Communication/tutorialrank.com
CIS 524 Effective Communication/tutorialrank.comjonhson185
 
Local Service Search Engine Management System LSSEMS
Local Service Search Engine Management System LSSEMSLocal Service Search Engine Management System LSSEMS
Local Service Search Engine Management System LSSEMSYogeshIJTSRD
 

Ähnlich wie Design Patterns : Solution to Software Design Problems (20)

Webinar on Design Patterns titled 'Dive into Design Patterns'
Webinar on Design Patterns titled 'Dive into Design Patterns'Webinar on Design Patterns titled 'Dive into Design Patterns'
Webinar on Design Patterns titled 'Dive into Design Patterns'
 
Webinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software DevelopmentWebinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software Development
 
Modeling Object Oriented Applications by Using Dynamic Information for the I...
Modeling Object Oriented Applications by Using Dynamic  Information for the I...Modeling Object Oriented Applications by Using Dynamic  Information for the I...
Modeling Object Oriented Applications by Using Dynamic Information for the I...
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
Software Engineering Past Papers Notes
Software Engineering Past Papers Notes Software Engineering Past Papers Notes
Software Engineering Past Papers Notes
 
3. ch 2-process model
3. ch 2-process model3. ch 2-process model
3. ch 2-process model
 
6. ch 5-understanding requirements
6. ch 5-understanding requirements6. ch 5-understanding requirements
6. ch 5-understanding requirements
 
Design pattern application
Design pattern applicationDesign pattern application
Design pattern application
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
Facade Design Pattern
Facade Design PatternFacade Design Pattern
Facade Design Pattern
 
Web engineering
Web engineeringWeb engineering
Web engineering
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 
IOSR Journals
IOSR JournalsIOSR Journals
IOSR Journals
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Design patterns
Design patternsDesign patterns
Design patterns
 
CIS 524 Effective Communication/tutorialrank.com
 CIS 524 Effective Communication/tutorialrank.com CIS 524 Effective Communication/tutorialrank.com
CIS 524 Effective Communication/tutorialrank.com
 
Local Service Search Engine Management System LSSEMS
Local Service Search Engine Management System LSSEMSLocal Service Search Engine Management System LSSEMS
Local Service Search Engine Management System LSSEMS
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 

Mehr von Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 

Mehr von Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Kürzlich hochgeladen

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Kürzlich hochgeladen (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Design Patterns : Solution to Software Design Problems

  • 1. www.edureka.co/design-patterns View Design Patterns course details at www.edureka.co/design-patterns For Queries: Post on Twitter @edurekaIN: #askEdureka Post on Facebook /edurekaIN For more details please contact us: US : 1800 275 9730 (toll free) INDIA : +91 88808 62004 Email us : webinars@edureka.co Design Patterns : Solution to Software Design Problems
  • 2. Slide 2 www.edureka.co/design-patterns At the end of this session, you will be able to: Objectives  Know what are Software Design Patterns  Understand the need of Software Design Patterns  Distribute Responsibility using Chain Of Responsibility Pattern  Communicate among objects with Mediator Pattern  Understand Observer Patterns
  • 3. Slide 3 www.edureka.co/design-patterns Software Design Patterns & Gang Of Four(GOF)  Software design patterns describe relationship among classes to solve a general and repeatable design problem in a specific context with proven solution  Anyone who knows something about Software Design Patterns will certainly be aware of famous book “Elements of Reusable Object-Oriented Software” written by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides popularly knows as Gang Of Four(GOF) This is the most popular book written on Software Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, known as Gang Of Four
  • 4. Slide 4 www.edureka.co/design-patterns Classification of Software Design Patterns Software Design Patterns Creational Design Pattern Factory Pattern Object Pool Pattern Singleton Pattern Structural Design Pattern Adapter Pattern Decorator Pattern Composite Pattern Behavioral Design Pattern Chain of Responsibility Pattern Mediator Pattern ObserverPattern Concurrency Design Pattern Reactor Pattern Scheduler Pattern Thread Pool Pattern . . . . . . . . . . . .
  • 5. Slide 5 www.edureka.co/design-patterns Importance of Design Patterns  Just knowing a Programming Language is not enough to engineer a software application  While building an application its important that we keep the future requirements and changes in mind otherwise you will have to change the code that you had written earlier  Building a large application is never easy, so its very important that you design it correctly and then start coding the application  Design Patterns provides efficient techniques to create a flexible application design
  • 6. Slide 6Slide 6Slide 6 www.edureka.co/design-patterns  Chain Of Responsibility pattern gives more than one object a chance to handle the request  Sender of the request does not know which object in the chain will serve its request  In Chain Of Responsibility pattern a chain of request handlers is maintained, a handler decides whether it can handle the request or not, if not then it passes the request to next handler Chain of Responsibility (COR) Receiver 1 Receiver 2 Receiver 3 Request Request Request Receiver N Request Reference to Receiver 2 Reference to Receiver 3 Chain of Receiver Reference to Receiver 4 Cannot handle
  • 7. Slide 7Slide 7Slide 7 www.edureka.co/design-patterns 1. Handler - defines an interface for handling requests 2. ConcreteHandler - handles the requests it is responsible for .If it can handle the request it does so, otherwise it sends the request to its successor 3. Client - sends commands to the first object in the chain that may handle the command Handler +HandleRequest() ConcreteHandler1 +HandleRequest() ConcreteHandler2 +HandleRequest() Client Chain of Responsibility - UML Diagram
  • 8. Slide 8Slide 8Slide 8 www.edureka.co/design-patterns Problem Statement  Customer support system is one of the implementation of this pattern, where users calls the help desk (L1 support) and tell their problem L1 Support L2 Support Cannot handle Problem Statement Resolved Resolved YES NO YES NO Request goes through multiple objects (handlers)
  • 9. Slide 9Slide 9Slide 9 www.edureka.co/design-patterns Solution  Using Chain of responsibility simplifies the request object because it does not have to know the chain’s structure and keep direct references to its members  In this case, user simply interact with help desk and the request internally goes through multiple handlers  User does not need to know about the different handlers
  • 10. Slide 10Slide 10Slide 10 www.edureka.co/design-patterns Implementing Chain of Responsibility Client (user) will generate a SupportRequest (a ticket) All support levels will have to inherit the support class and implement the handleRequest()
  • 11. Slide 11Slide 11Slide 11 www.edureka.co/design-patterns Implementing Chain of Responsibility (Contd.)
  • 12. Slide 12Slide 12Slide 12 www.edureka.co/design-patterns Implementing Chain of Responsibility (Contd.)
  • 13. Slide 13Slide 13Slide 13 www.edureka.co/design-patterns Implementing Chain of Responsibility (Contd.) Here we are creating chain of responsible objects for handling the support request according to user query All the support requests will first go to L1 support Output
  • 14. Slide 14Slide 14Slide 14 www.edureka.co/design-patterns Other Uses Of Chain of Responsibility One of the most important use of Chain Of Responsibility pattern is to implement filter mechanism Here one filter process the request and then passes on to next filter in the chain, similarly next filter processes the request and then passes onto next filter in chain JavaEE API uses Chain Of Responsibility pattern to implement filter mechanism using the following doFilter() method javax.servlet.Filter#doFilter(ServletRequest request, ServletResponse response, FilterChain chain) Request Logging Filter Authentication Filter Servlet JAX-WS also uses Chain Of Responsibility pattern to implement JWS Handler Framework, which allows manipulation of SOAP messages
  • 15. Slide 15Slide 15Slide 15 www.edureka.co/design-patterns Mediator Pattern  The mediator pattern promotes loose coupling of objects by removing the need for classes to communicate with each other directly  Instead, mediator objects are used to encapsulate and centralize the interactions between classes  Mediator pattern simplifies communication in general when a program contains large number of classes that interact  Each class only needs to know how to pass messages to its mediator, rather than to numerous colleagues
  • 16. Slide 16Slide 16Slide 16 www.edureka.co/design-patterns Mediator Pattern – UML Diagram  Mediator - defines an interface for communicating with Colleague objects  ConcreteMediator - knows the colleague classes and keep a reference to the colleague objects  Colleague classes - keep a reference to its Mediator object Mediator ConcreteMediator ConcreteColleagueA ConcreteColleagueB Colleague
  • 17. Slide 17Slide 17Slide 17 www.edureka.co/design-patterns Problem Statement  Suppose you have to create a chat application where multiple users can chat together  Rather than each user sending the message directly to other users, we can use mediator pattern to implement this design
  • 18. Slide 18Slide 18Slide 18 www.edureka.co/design-patterns Implementing Mediator Pattern ChatMediator keeps the reference of all the users
  • 19. Slide 19Slide 19Slide 19 www.edureka.co/design-patterns Implementing Mediator Pattern (Contd.) A User doesn’t have any reference to other users
  • 20. Slide 20Slide 20Slide 20 www.edureka.co/design-patterns Output Implementing Mediator Pattern (Contd.)
  • 21. Slide 21Slide 21Slide 21 www.edureka.co/design-patterns ContactSelectorPanel ContactDisplayPanel ContactEditorPanel 1. All GUI applications consists of small components like Windows, Panel etc. 2. Each Panel contains a group of GUI element 3. These panels have to co-ordinate among themselves 4. As in this application, whenever a contact is selected from the drop down box, its details should be updated in the ContactDisplayPanel and ContactEditorPanel 5. Rather then one panel having reference of all other panels, we can use Mediator Pattern to simplify the communication between panel objects Implementing Mediator Pattern (Contd.)
  • 22. Slide 22 www.edureka.co/design-patterns Observer Pattern Observer SubjectObserves notify Observer: There is someone watching you
  • 23. Slide 23 www.edureka.co/design-patterns Reference : tutorialspoint.com Observer Pattern
  • 24. Slide 24 www.edureka.co/design-patterns Conclusion  Similarly there are other design patterns to solve majority of the problems that software designers encounter during their day to day activities  Design patterns compliments ones experience and helps them deliver wonderful and successful software designs  They serve as common nomenclature or jargon that architects can easily communicate with others in software industry  Software design is no more an art. It’s a skill one can learn. And thanks to design patterns