Case Studies on Design Patterns Design Refinements Examples.

Slides:



Advertisements
Similar presentations
Creational Patterns (2) CS350/SE310 Fall, Lower the Cost of Maintenance Economic Goal Coupling-Cohesion, Open-Close, Information-Hiding, Dependency.
Advertisements

Creational Patterns, Abstract Factory, Builder Billy Bennett June 11, 2009.
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.
COP 3331 Object Oriented Analysis and Design Chapter 7 – Design by Abastraction Jean Muhammad.
Design Pattern: Mediator Mediator Modified from Kyle Kimport’s: Design Patterns: Mediator Design Patterns: Mediator Ref:
SWE 4743 Strategy Patterns Richard Gesick. CSE Strategy Pattern the strategy pattern (also known as the policy pattern) is a software design.
. Plab – Tirgul 12 Design Patterns. Design Patterns u The De-Facto Book on Design Patterns:
BehavioralCmpE196G1 Behavioral Patterns Chain of Responsibility (requests through a chain of candidates) Command (encapsulates a request) Interpreter (grammar.
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.
Design Patterns Based on Design Patterns. Elements of Reusable Object-Oriented Software. by E.Gamma, R. Helm, R. Johnson,J. Vlissides.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
Reuse Activities Selecting Design Patterns and Components
Chapter 22 Object-Oriented Design
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Behavioral Patterns C h a p t e r 5 – P a g e 128 BehavioralPatterns Design patterns that identify and realize common interactions between objects Chain.
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
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
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.
Facade Introduction. Intent Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the.
Unit 4 Object-Oriented Design Patterns NameStudent Number CAI XIANGHT082182A KYAW THU LINHT082238Y LI PENGFEIHT082220L NAUNG NAUNG LATTHT082195L PLATHOTTAM.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VIII Chain of Responsibility, Strategy, State.
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.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Strategy Pattern.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
FACTORY METHOD. Design Pattern Space Purpose ScopeCreationalStructuralBehavioral ClassFactory MethodAdapterInterpreter Template Method ObjectAbstract.
Manali Joshi1 The Observer Design Pattern Presented By: Manali Joshi.
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1.
Behavioral Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
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.
The Facade Pattern (Structural) ©SoftMoore ConsultingSlide 1.
CSC 480 Software Engineering Lab 5 – Abstract Factory Pattern Oct 30, 2002.
Watching the movie the hard way…. Page 256 – Head First Design Patterns.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
An object's behavior depends on its current state. Operations have large, multipart conditional statements that depend on the object's state.
STRATEGY PATTERN By Michelle Johnson. BACKGROUND Behavioral Pattern Allow you to define a family of algorithms, encapsulate each one, and make them interchangeable.
Abstract Factory Pattern Jiaxin Wang CSPP Winter 2010.
OBSERVER PATTERN OBSERVER PATTERN Presented By Presented By Ajeet Tripathi ISE
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Presented by FACADE PATTERN
Design Patterns: MORE Examples
Software Design Refinement Using Design Patterns
Mediator Design Pattern
Strategy: A Behavioral Design Pattern
Abstract Factory Pattern
Strategy Design Pattern
Strategy Pattern Jim Fawcett CSE776 – Design Patterns Fall 2014.
Façade Pattern:.
Factory Patterns 1.
Instructor: Dr. Hany H. Ammar
Facade Pattern Jim Fawcett CSE776 – Design Patterns Summer 2010
Abstract Factory Pattern
Presented by Igor Ivković
State Design Pattern 1.
Mediator Design Pattern (Behavioral)
Informatics 122 Software Design II
BRIDGE PATTERN.
Informatics 122 Software Design II
Presented by Igor Ivković
Strategy Pattern Jim Fawcett CSE776 – Design Patterns Fall 2014.
Presentation transcript:

Case Studies on Design Patterns Design Refinements Examples

Outline n Case Study-1: coordination between colleagues using the Mediator pattern n Case Study-2: Job Application design using the Strategy pattern n Case Study-3: The Maze Game design using the Abstract Factory pattern

Case Study-1 n The application consists of tracking the states of the three colleague components and keeping their state identical. n There are two versions, one with no patterns and the other with Mediator pattern. n In the simple version that does not employ any design pattern all the colleague components are tightly coupled. When one colleague changes state, it changes the others accordingly. n In the version that employs a mediator pattern, the three colleague components are completely decoupled with respect to each other. The Mediator class takes care of keeping the states of the colleagues identical. n Mediator design pattern reduces the dependency between the components and increases the reusability, extensibility and maintainability of the software architecture.

Class Diagram before applying pattern

The Mediator Pattern n 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.

The Mediator Pattern F Colleagues send and receive requests from a Mediator object. The mediator implements the cooperative behavior by routing requests between the appropriate colleague(s).

Class Diagram after applying mediator

Case Study-2 n The application consists of processing job applications applied to various positions. n There are two versions, one with no patterns and the other with Strategy pattern. n The simple version which does not employ any design pattern uses a switch case in the validate method to process each job application basing on the position applied to. n In the version that employs strategy pattern, each switch case is considered as a strategy, a subclass of the abstract class-Form Validator. n The advantages of this pattern are elimination of conditional statements and easier to extend new strategies without recoding the application.

Class Diagram before applying pattern

The Strategy Pattern n The Strategy Pattern: lets the algorithm vary independently from clients that use it Abstract Class Interface Class Strategy A Strategy BStrategy C Default Strategy

Class Diagram after applying strategy

n This application consists the design of a game called maze. n There are two versions, one with no patterns and the other with Abstract Factory pattern. n In the version that employs abstract factory pattern, the two different designs are implemented as two different families. n The benefits of this design pattern are to isolate the concrete components and help in exchanging the product families. Case Study-3

The Abstract Factory Pattern F Intent: Provide an interface for creating families of related or dependent objects without specifying their concrete classes

Class Diagram before applying pattern

Class Diagram after applying abstract factory