SlideShare a Scribd company logo
1 of 17
SOFTWARE ARCHITECTURE AND DESIGN
PATTERNS
UNIT-V
Mediator(Bheavioural)
Intent: Define an object that encapsulates how a
set o f objects interact. Mediator promotes
loose coupling by keeping objects from
referring to each other explicitly, and it lets
you vary their interaction independently.
MEDIATOR
Sample code
Applicability: Use the Mediator pattern when
• A set of objects communicate in well-defined but
complex ways. The resulting interdependencies
are unstructured and difficult to understand.
• Reusing an object is difficult because it refers to
and communicates with many other objects.
• A behavior that's distributed between several
classes should be customizable without a lot of
sub classing.
Collaborations
• Colleagues send and receive requests from a Mediator
object. The mediator implements the cooperative
behavior by routing requests between the appropriate
colleague
Consequences: The Mediator pattern has the following
benefits and drawbacks:
• It limits subclassing
• It decouples colleagues
• It simplifies object protocols
Related Patterns
• Facade differs from Mediator in that it
abstracts a subsystem of objects to provide a
more convenient interface
• Colleagues can communicate with the
mediator using the Observer pattern
• Mediator – defines the interface for communication
between Colleague objects
• ConcreteMediator – implements
the Mediator interface and coordinates communication
between Colleague objects. It is aware of all of the
Colleagues and their purposes with regards to inter-
communication.
• Colleague – defines the interface for communication
with other Colleagues through its Mediator
• ConcreteColleague – implements
the Colleague interface and communicates with other
Colleagues through its Mediator
• Implementation: The following implementation issues are relevant to the
Mediator pattern:
Omitting the abstract Mediator class. There's
no need to define an abstract Mediator class
when colleagues work with only one mediator.
The abstract coupling that the Mediator class
provides lets colleagues work with different
Mediator subclasses, and vice versa.

More Related Content

Similar to Mediator.pptx

effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptxDr.Shweta
 
Design patterns Structural
Design patterns StructuralDesign patterns Structural
Design patterns StructuralUMAR ALI
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their applicationHiệp Tiến
 
System software design1
System software design1System software design1
System software design1PrityRawat2
 
common design patterns summary.pdf
common design patterns summary.pdfcommon design patterns summary.pdf
common design patterns summary.pdfNikolayRaychev2
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...Simplilearn
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityShubham Narkhede
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering Bilal Hassan
 
IBM OOAD Part1 Summary
IBM OOAD Part1 SummaryIBM OOAD Part1 Summary
IBM OOAD Part1 SummaryHaitham Raik
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & PatternsInocentshuja Ahmad
 
Design patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designDesign patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designKamran Haider
 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patternsiasaglobal
 
Cse 6007 fall2012
Cse 6007 fall2012Cse 6007 fall2012
Cse 6007 fall2012rhrashel
 

Similar to Mediator.pptx (20)

effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptx
 
Design patterns Structural
Design patterns StructuralDesign patterns Structural
Design patterns Structural
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 
System software design1
System software design1System software design1
System software design1
 
common design patterns summary.pdf
common design patterns summary.pdfcommon design patterns summary.pdf
common design patterns summary.pdf
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur University
 
Mediator pattern
Mediator patternMediator pattern
Mediator pattern
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering
 
Agile cards
Agile cardsAgile cards
Agile cards
 
IBM OOAD Part1 Summary
IBM OOAD Part1 SummaryIBM OOAD Part1 Summary
IBM OOAD Part1 Summary
 
ds2p1.pptx
ds2p1.pptxds2p1.pptx
ds2p1.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
 
Design patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designDesign patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and design
 
Software design
Software designSoftware design
Software design
 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
 
Cse 6007 fall2012
Cse 6007 fall2012Cse 6007 fall2012
Cse 6007 fall2012
 

Recently uploaded

Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 

Recently uploaded (20)

Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 

Mediator.pptx

  • 1. SOFTWARE ARCHITECTURE AND DESIGN PATTERNS UNIT-V
  • 2. Mediator(Bheavioural) Intent: Define an object that encapsulates how a set o f objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
  • 4.
  • 5.
  • 6.
  • 7.
  • 9.
  • 10.
  • 11. Applicability: Use the Mediator pattern when • A set of objects communicate in well-defined but complex ways. The resulting interdependencies are unstructured and difficult to understand. • Reusing an object is difficult because it refers to and communicates with many other objects. • A behavior that's distributed between several classes should be customizable without a lot of sub classing.
  • 12. Collaborations • Colleagues send and receive requests from a Mediator object. The mediator implements the cooperative behavior by routing requests between the appropriate colleague Consequences: The Mediator pattern has the following benefits and drawbacks: • It limits subclassing • It decouples colleagues • It simplifies object protocols
  • 13.
  • 14.
  • 15. Related Patterns • Facade differs from Mediator in that it abstracts a subsystem of objects to provide a more convenient interface • Colleagues can communicate with the mediator using the Observer pattern
  • 16. • Mediator – defines the interface for communication between Colleague objects • ConcreteMediator – implements the Mediator interface and coordinates communication between Colleague objects. It is aware of all of the Colleagues and their purposes with regards to inter- communication. • Colleague – defines the interface for communication with other Colleagues through its Mediator • ConcreteColleague – implements the Colleague interface and communicates with other Colleagues through its Mediator
  • 17. • Implementation: The following implementation issues are relevant to the Mediator pattern: Omitting the abstract Mediator class. There's no need to define an abstract Mediator class when colleagues work with only one mediator. The abstract coupling that the Mediator class provides lets colleagues work with different Mediator subclasses, and vice versa.