Mediator Design Pattern (Behavioral)

Slides:



Advertisements
Similar presentations
GoF State Pattern Aaron Jacobs State(305) Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
Advertisements

UMBC Some Additional Patterns CMSC 432. UMBC More Patterns2 Introduction Over the next few lectures we’ll have an introduction to a number of patterns.
Amirkabir University of Technology, Computer Engineering Faculty, Intelligent Systems Laboratory 1 Mediator Abbas Rasoolzadegan.
Observer Method 1. References Gamma Erich, Helm Richard, “Design Patterns: Elements of Reusable Object- Oriented Software” 2.
Design Pattern: Mediator Mediator Modified from Kyle Kimport’s: Design Patterns: Mediator Design Patterns: Mediator Ref:
Lecture 13 UML diagrams state-chart diagrams Design Pattern.
BehavioralCmpE196G1 Behavioral Patterns Chain of Responsibility (requests through a chain of candidates) Command (encapsulates a request) Interpreter (grammar.
Design Patterns CS is not simply about programming
Cam Quach Joel Derstine Mediator: Object Behavioral.
Copyright © Active Frameworks Inc. - All Rights Reserved.More On Behavioral Patterns - Page L9-1 PS95&96-MEF-L16-1 Dr. M.E. Fayad Creationa l.
Mediator A Behavioral Design Pattern for the New Millennium Cory Nugent.
Design Pattern – Bridge (Structural) References Yih-shoung Chen, Department of Information Engineering, Feng Chia University,Taiwan, R.O.C. The Bridge.
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
BY VEDASHREE GOVINDA GOWDA
BDP Behavioral Pattern. BDP-2 Behavioral Patters Concerned with algorithms & assignment of responsibilities Patterns of Communication between Objects.
Design Patterns.
A Behavior Object Pattern
Emeka Egbuonye CSPP March 02,2010 The Mediator Pattern.
Case Studies on Design Patterns Design Refinements Examples.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
Mediator Pattern and Multiuser Protection Billy Bennett June 8 th, 2009.
Y2 eProjects Session 4 – Advanced Topics. Objectives  Dynamic Models  Design Patterns (Optional)  Software testing (for S4) ACCP i7.1\Sem3_4\eProject\T4.
Real Time Auction System Metex Systems Inc.. Inside the UML The Problem Auctioning in real time over the Web requires that many people connect and participate.
Behavioral Design Patterns Morteza Yousefi University Of Science & Technology Of Mazandaran 1of 27Behavioral Design Patterns.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Mediator Kensho Tsuchihashi. Mediator Page 2 Table of Contents 1.What is Mediator? 2.What problem does Mediator solve? 3.Advantage and Disadvantage 4.Additional.
Behavioural Design Patterns Quote du jour: ECE450S – Software Engineering II I have not failed. I've just found 10,000 ways that won't work. - Thomas Edison.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
Manali Joshi1 The Observer Design Pattern Presented By: Manali Joshi.
Behavioral Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams.
Using Software Design Patterns Bill Anderson. About me Fox developer since 1987 Fox developer since 1987 Program Director, Los Angeles Visual Foxpro Developers.
The Mediator Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Behavioral Pattern: Mediator C h a p t e r 5 – P a g e 169 When a program is made up of several classes, the logic and computation is divided among these.
OBSERVER PATTERN OBSERVER PATTERN Presented By Presented By Ajeet Tripathi ISE
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
1 Lecture Material Design Patterns Visitor Client-Server Factory Singleton.
Patterns An Easier Way to Think About Common Software Designs This presentation is licensed under a Creative Commons License.
Presented by FACADE PATTERN
Design Patterns: MORE Examples
Mediator Design Pattern
Strategy Design Pattern
The Object-Oriented Thought Process Chapter 15
Chapter 10 Design Patterns.
Software Design Patterns
MPCS – Advanced java Programming
Pertemuan 08 Design Patterns & Anti-Patterns
Introduction to Design Patterns
Observer Design Pattern
Part 3 Design What does design mean in different fields?
object oriented Principles of software design
Presented by Igor Ivković
Multiuser Protection and the Mediator Pattern
State Design Pattern 1.
Design Pattern: Visitor
Informatics 122 Software Design II
Mediator.
Object Oriented Design Patterns - Structural Patterns
Object Oriented Design Patterns - Behavioral Patterns
Behavioral Design Pattern
Advanced ProgramMING Practices
Advanced ProgramMING Practices
Informatics 122 Software Design II
Design Patterns (Gamma, Helm, Johnson, Vlissides)
Composite Design Pattern By Aravind Reddy Patlola.
Presented by Igor Ivković
Software Design Lecture : 27.
Presentation transcript:

Mediator Design Pattern (Behavioral) -Seema Joshi

Intent Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently. 03/04/03 CS590L Mediator Pattern

Motivation Object oriented design encourages the distribution of behavior among objects. Partitioning a system into many objects enhances reusability. Many connections between objects in an object structure. -Lots of interconnections increases interdependency. -Moreover it can be difficult to change the systems' behavior in any significant way, since behavior is distributed among many objects. 03/04/03 CS590L Mediator Pattern

Applicability When one or more objects must interact with several different objects. When simple object need to communicate in complex ways. When you want to reuse an object that frequently interacts with other objects. 03/04/03 CS590L Mediator Pattern

Example- Problem 03/04/03 CS590L Mediator Pattern

Example -Solution 03/04/03 CS590L Mediator Pattern

Example -Sequence Diagram 03/04/03 CS590L Mediator Pattern

Example -Steps The list box tells its director that it’s changed. The director gets the selection from the list box. The director passes the selection to the entry field. Director takes action. 03/04/03 CS590L Mediator Pattern

Example -Structure 03/04/03 CS590L Mediator Pattern

Example -Relationship DialogDirector is an abstract class that defines the overall behavior of a dialog. Clients call ShowDialog() CreateWidgets() –abstract operation for creating widgets. 03/04/03 CS590L Mediator Pattern

General Structure 03/04/03 CS590L Mediator Pattern

Participants Mediator ConcreteMediator Colleague classes -defines an interface for communicating with Colleague objects. ConcreteMediator -implements cooperative behavior by coordinating Colleague objects. -knows and maintains its colleagues. Colleague classes -each Colleague class knows its Mediator object. -each colleague communicates with its mediator whenever it would have otherwise communicated with another colleague. 03/04/03 CS590L Mediator Pattern

Another Example 03/04/03 CS590L Mediator Pattern

Good Points about the Mediator Centralized control Less chance of miscommunication. Simplifies object protocols Replaces many-to-many interactions with one-to-many interactions between mediator and colleagues, thus simple to understand, maintain and extend. Abstracts how objects cooperate Splitting up the system in this way creates a better understanding of the objects in the system, how they interact and how they are structured . Loose coupling between colleagues promotes Reusability Basically, it proliferates interconnections to help eventually reduce it. 03/04/03 CS590L Mediator Pattern

Bad Points about the Mediator Overloading the Mediator There is the potential for numerous subclasses of the Mediator and these in turn could require subclasses of those Mediator subclasses. It's just a horrible cycle from this point on. Hindrance If there are a relatively small group of objects, it may waste less time if they are able to speak to each other directly rather than through a Mediator. 03/04/03 CS590L Mediator Pattern

Related Patterns Facade Observer 03/04/03 CS590L Mediator Pattern

?????????????? You may have questions, if you didn’t pay attention during the presentation. 03/04/03 CS590L Mediator Pattern

References Design Patterns: Elements of Reuseable Object-Oriented Software by E. Gamma, R. Helm, R. Johnson and J. Vlissides, Addison-Wesley, ISBN: 0-201-63361-2, Copyright 1995. http://sern.ucalgary.ca/courses/SENG/443/W02/assignments/Mediator/ 03/04/03 CS590L Mediator Pattern

Thank You 03/04/03 CS590L Mediator Pattern