SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Mediator pattern
Intent
● Define an object that encapsulates how a set of
objects interact.
● Design an intermediary to decouple many
peers.
● Promote the many-to-many relationships
between interacting peers
Problem
● dependencies between the potentially reusable
pieces demonstrates the "spaghetti code"
phenomenon.
Motivation
● By consolidating all interaction in a single class,
we can regain elegance and reusability.
UML
Examples
Pros & Cons
Pros:
● Decouples colleagues, which facilitates independent
variations of the colleague and mediator classes.
● Simplifies protocol by replacing many-to-many interaction
with one-to-one interaction
Cons:
● Reducing the complexity of Colleagues increases
the complexity of the Mediator itself.
Related patterns
● Observer: the Mediator class may be
implemented using an Observer
● Facade: is similar to a Mediator, but with one-
way communication from the Facade to its
subsystem classes..
Mediator

Weitere Àhnliche Inhalte

Was ist angesagt?

The visitor design pattern
The visitor design patternThe visitor design pattern
The visitor design pattern
Samnang Chhun
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
chetankane
 
Design pattern composite 20120413 joncash 01
Design pattern composite 20120413 joncash 01Design pattern composite 20120413 joncash 01
Design pattern composite 20120413 joncash 01
LearningTech
 

Was ist angesagt? (20)

The visitor design pattern
The visitor design patternThe visitor design pattern
The visitor design pattern
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
 
Javascript design patterns
Javascript design patternsJavascript design patterns
Javascript 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
 
Advanced OOP - Laws, Principles, Idioms
Advanced OOP - Laws, Principles, IdiomsAdvanced OOP - Laws, Principles, Idioms
Advanced OOP - Laws, Principles, Idioms
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
Java design patterns
Java design patternsJava design patterns
Java design patterns
 
Visitor pattern
Visitor patternVisitor pattern
Visitor pattern
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design Patterns
 
Software Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSoftware Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural Patterns
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 
OOP design patterns
OOP design patternsOOP design patterns
OOP design patterns
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design pattern composite 20120413 joncash 01
Design pattern composite 20120413 joncash 01Design pattern composite 20120413 joncash 01
Design pattern composite 20120413 joncash 01
 
Bridge pattern
Bridge patternBridge pattern
Bridge pattern
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Design Patterns - 03 Composite and Flyweight Pattern
Design Patterns - 03 Composite and Flyweight PatternDesign Patterns - 03 Composite and Flyweight Pattern
Design Patterns - 03 Composite and Flyweight Pattern
 

Andere mochten auch

Lucky Crystal Collections
Lucky Crystal CollectionsLucky Crystal Collections
Lucky Crystal Collections
Joy Lee
 
Scheepsbezoek queen elizabeth 2015
Scheepsbezoek queen elizabeth 2015Scheepsbezoek queen elizabeth 2015
Scheepsbezoek queen elizabeth 2015
Luc De Smedt
 
Kauri Cliffs Golf Course Yardage Chart
Kauri Cliffs Golf Course Yardage Chart Kauri Cliffs Golf Course Yardage Chart
Kauri Cliffs Golf Course Yardage Chart
Paul Thornton
 
SISTEMA NERVIOSO
SISTEMA NERVIOSOSISTEMA NERVIOSO
SISTEMA NERVIOSO
olivertbello
 
0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集
0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集
0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集
ASUSCloud
 

Andere mochten auch (20)

Memento pattern
Memento patternMemento pattern
Memento pattern
 
Observer Pattern
Observer PatternObserver Pattern
Observer Pattern
 
Observer pattern
Observer patternObserver pattern
Observer pattern
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design Patterns
 
Lucky Crystal Collections
Lucky Crystal CollectionsLucky Crystal Collections
Lucky Crystal Collections
 
Cruise celebrity eclipse algemene informatie
Cruise celebrity eclipse   algemene informatieCruise celebrity eclipse   algemene informatie
Cruise celebrity eclipse algemene informatie
 
Osha assig.
Osha assig.Osha assig.
Osha assig.
 
Scheepsbezoek queen elizabeth 2015
Scheepsbezoek queen elizabeth 2015Scheepsbezoek queen elizabeth 2015
Scheepsbezoek queen elizabeth 2015
 
Indi go airlines
Indi go airlinesIndi go airlines
Indi go airlines
 
Kauri Cliffs Golf Course Yardage Chart
Kauri Cliffs Golf Course Yardage Chart Kauri Cliffs Golf Course Yardage Chart
Kauri Cliffs Golf Course Yardage Chart
 
SISTEMA NERVIOSO
SISTEMA NERVIOSOSISTEMA NERVIOSO
SISTEMA NERVIOSO
 
PSYCHO COMIC SLIDES
PSYCHO COMIC SLIDESPSYCHO COMIC SLIDES
PSYCHO COMIC SLIDES
 
ECONS REPORT
ECONS REPORTECONS REPORT
ECONS REPORT
 
Private Label
Private LabelPrivate Label
Private Label
 
Charter airline
Charter airlineCharter airline
Charter airline
 
Epc assignment 1 photo blog
Epc assignment 1 photo blogEpc assignment 1 photo blog
Epc assignment 1 photo blog
 
Wynn energy resources and agriculture
Wynn energy resources  and agricultureWynn energy resources  and agriculture
Wynn energy resources and agriculture
 
Offshore manufacturing
Offshore manufacturingOffshore manufacturing
Offshore manufacturing
 
0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集
0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集
0527 asus cloud day é–‹æ”Ÿă€‚ćŒ•é ˜æ•žäœć…§ćźčé€Čè»ćœ‹éš› – èŻçą©é›Č端枂集
 
Disruptive businesses
Disruptive businessesDisruptive businesses
Disruptive businesses
 

Ähnlich wie Mediator

Mediator.pptx
Mediator.pptxMediator.pptx
Mediator.pptx
sree kanth
 
what is differance between abstract class and interface ppt
what is differance between abstract class and interface pptwhat is differance between abstract class and interface ppt
what is differance between abstract class and interface ppt
manojsharma469262
 
Software architecture
Software architectureSoftware architecture
Software architecture
Inam Soomro
 

Ähnlich wie Mediator (20)

Object Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshopObject Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshop
 
Design Patterns Part1
Design Patterns  Part1Design Patterns  Part1
Design Patterns Part1
 
Grasp oose week 14.pdf
Grasp oose week 14.pdfGrasp oose week 14.pdf
Grasp oose week 14.pdf
 
Design Principles to design Patterns
Design Principles to design PatternsDesign Principles to design Patterns
Design Principles to design Patterns
 
Agile cards
Agile cardsAgile cards
Agile cards
 
Unified Modelling Language
Unified Modelling Language Unified Modelling Language
Unified Modelling Language
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
 
Mediator.pptx
Mediator.pptxMediator.pptx
Mediator.pptx
 
Concepts of oops
Concepts of oopsConcepts of oops
Concepts of oops
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka Pradhan
 
what is differance between abstract class and interface ppt
what is differance between abstract class and interface pptwhat is differance between abstract class and interface ppt
what is differance between abstract class and interface ppt
 
Advanced Programming _Abstract Classes vs Interfaces (Java)
Advanced Programming _Abstract Classes vs Interfaces (Java)Advanced Programming _Abstract Classes vs Interfaces (Java)
Advanced Programming _Abstract Classes vs Interfaces (Java)
 
Share Discovering the Power of Object-Oriented Programming 🔍đŸ’Ș
Share Discovering the Power of Object-Oriented Programming 🔍đŸ’ȘShare Discovering the Power of Object-Oriented Programming 🔍đŸ’Ș
Share Discovering the Power of Object-Oriented Programming 🔍đŸ’Ș
 
From Good to SOLID: How to become a better PHP developer
From Good to SOLID: How to become a better PHP developerFrom Good to SOLID: How to become a better PHP developer
From Good to SOLID: How to become a better PHP developer
 
Software architecture
Software architectureSoftware architecture
Software architecture
 
Lecture 4-oop class diagram
Lecture 4-oop class diagramLecture 4-oop class diagram
Lecture 4-oop class diagram
 
Basic design pattern interview questions
Basic design pattern interview questionsBasic design pattern interview questions
Basic design pattern interview questions
 
Mca 504 dotnet_unit4
Mca 504 dotnet_unit4Mca 504 dotnet_unit4
Mca 504 dotnet_unit4
 
Boston Startup School - OO Design
Boston Startup School - OO DesignBoston Startup School - OO Design
Boston Startup School - OO Design
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

KĂŒrzlich hochgeladen (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Mediator

  • 2. Intent ● Define an object that encapsulates how a set of objects interact. ● Design an intermediary to decouple many peers. ● Promote the many-to-many relationships between interacting peers
  • 3. Problem ● dependencies between the potentially reusable pieces demonstrates the "spaghetti code" phenomenon.
  • 4. Motivation ● By consolidating all interaction in a single class, we can regain elegance and reusability.
  • 5. UML
  • 7.
  • 8. Pros & Cons Pros: ● Decouples colleagues, which facilitates independent variations of the colleague and mediator classes. ● Simplifies protocol by replacing many-to-many interaction with one-to-one interaction Cons: ● Reducing the complexity of Colleagues increases the complexity of the Mediator itself.
  • 9. Related patterns ● Observer: the Mediator class may be implemented using an Observer ● Facade: is similar to a Mediator, but with one- way communication from the Facade to its subsystem classes..