CS 325: Software Engineering February 12, 2015 Applying Responsibility-Assignment Patterns Design Patterns Situation-Specific Patterns Responsibility-Assignment.

Slides:



Advertisements
Similar presentations
GRASP: Designing Objects with Responsibilities
Advertisements

SE2811 Week 7, Class 2 The Gang of Four and more … Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
© Keith Vander Linden, Dilbert © United Feature Syndicate, Inc.
GRASP Patterns M Taimoor Khan
Design Patterns Yes, they are important Robert Cotton April 23, 2009.
Fundamentals of Software Development 1Slide 1 Gang of Four The beginnings… The original “patterns” idea was from architecture – there are repeatable patterns.
Design Patterns Daniel McClain. Background What are they?  Way of recording solutions to recurring design problems History  “A Pattern Language: Towns,
Introduction to Design Patterns (1). “ In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software.
Ralph Johnson - University of Illinois1 Patterns: What They Are, and How to Write Them Ralph Johnson University of Illinois at Urbana-Champaign
Fall 2009ACS-3913 Ron McFadyen1 idea was first put forth by Christopher Alexander (1977) in his work on architectural design principles a pattern is a.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
February Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m.
OOHDM Hypermedia Research Work Designing Web-based applications with Object Oriented Hypermedia Design Method OOHDM.
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Low Coupling High Cohesion
Adapters Presented By Zachary Dea. Definition A pattern found in class diagrams in which you are able to reuse an ‘adaptee’ class by providing a class,
GRASP : Designing Objects with Responsibilities
Design Patterns and Responsibility Assignment CMPT 371 Fall 2004 J.W. Benham.
Fall 2009ACS-3913 Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Date: 1753 an interpretation.
Chapter 7 GRASP patterns Dr Seham Mostefai CAP 252.
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
1 Copyright © 2014 Atego. Patterns INCOSE MBSE WG – Simon A. Perry - Atego.
Introduction to Design Patterns (1). Definition: “ In software engineering, a design pattern is a general reusable solution to a commonly occurring problem.
1 Chapter 17 GRASP Design Patterns: Designing Objects with Responsibilities.
Advanced topics in software engineering CSC532 Term Paper Design Patterns Harpreet Singh Submitted By:-
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
101 User Interface Patterns and its applications Tonya Groover Department of Computer Science.
Requirements To Design--Iteratively Chapter 12 Applying UML and Patterns Craig Larman.
Aniruddha Chakrabarti
BTS430 Systems Analysis and Design using UML Design Patterns.
Powerpoint Templates Page 1 Powerpoint Templates What is Design Patterns ? by Indriati Teknik Informatika – UB.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Design Patterns. Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.
D ESIGN P ATTERNS Weslei A. de T. Marinho. T ALK O UTLINE Pattern Definition GRASP Patterns GoF Patterns GoF Patterns Classification Creational Patterns.
GRASP: Designing Objects with Responsibilities
What to remember from Chap 13 (Logical architecture)
CS 160: Software Engineering October 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Advanced Object-Oriented Design Patterns and Architectures Part One COEN396A John Xiao
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
TK2023 Object-Oriented Software Engineering CHAPTER 8 LOGICAL ARCHITECTURE.
Copyright © Craig Larman All Rights Reserved COMP-350 Object-Oriented Analysis and Design GRASP: Designing Objects with Responsibilities Reference:
Chapter 17 Designing with Responsibilities. Fig
GRASP: More Patterns for Assigning Responsibilities Presented By Dr. Shazzad Hosain.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Introduction To Design Patterns
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
GRASP – Designing Objects with Responsibilities
The Object-Oriented Thought Process Chapter 15
MPCS – Advanced java Programming
Pertemuan 08 Design Patterns & Anti-Patterns
Conception OBJET GRASP Patterns
Design Patterns Introduction
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
GRASP : Designing Objects with Responsibilities
Advanced Programming Behnam Hatami Fall 2017.
DESIGNING YOUR SYSTEM.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
Introduction to Design Patterns
Design Patterns Imran Rashid CTO at ManiWeber Technologies.
Software Design Lecture : 27.
Presentation transcript:

CS 325: Software Engineering February 12, 2015 Applying Responsibility-Assignment Patterns Design Patterns Situation-Specific Patterns Responsibility-Assignment Patterns The Controller Pattern The Expert Pattern The Creator Pattern

Design Patterns CS 325 February 12, 2015 Page 87 Design patterns are general repeatable solutions to commonly occurring problems in software design. Patterns originated as an architectural concept by Christopher Alexander in the late 1970s.

Design Patterns CS 325 February 12, 2015 Page 88 In 1987, Kent Beck and Ward Cunningham began experimenting with the idea of applying patterns to programming. Design patterns gained popularity in computer science after the 1994 publication of Design Patterns: Elements of Reusable Object-Oriented Software by the “Gang of Four”: Erich Gamma, Richard Helm, Ralph Johnson, & John Vlissides.

Situation-Specific Patterns CS 325 February 12, 2015 Page 89 The classical Gang-of-Four design patterns are situation- specific, where each pattern is applied to particular type of software design problem. Stuctural Patterns describe how to combine objects into larger structures. Creational Patterns employ methods and objects to instantiate other objects. Behavioral Patterns address common object interactions.

Responsibility-Assignment Patterns CS 325 February 12, 2015 Page 90 A second type of design pattern, developed by Craig Larman in 2005, focuses on assigning appropriate responsibilities to the objects within a software system. High Cohesion ensures that the responsibilities of a given software element are strongly related and highly focused (e.g., breaking programs into classes and subsystems). Loose Coupling assigns responsibilities to support lower dependency between the classes and higher reuse potential by ensuring that change in one class has little impact on other classes. Polymorphism assigns the responsibility of defining any variation of behavior based upon type to the types for which the variation happens.

The Controller Pattern CS 325 February 12, 2015 Page 91 Having the user interface of a system handle user requests to the system forces the UI to know too much about the internal system, but having the internal system handle user requests forces the internal system to know too much about the UI. Inserting a “controller” class in between the UI and the internal system loosens their coupling, reducing the change effect that they have on each other.

The Expert Pattern CS 325 February 12, 2015 Page 92 The Expert Pattern assigns the responsibility for handling a functional request to an object that has the information (e.g., the attributes) to fulfill the request. In this partial card game model, which class should handle requests for the current scoreboard?

The Creator Pattern CS 325 February 12, 2015 Page 93 The Creator Pattern addresses the issue of assigning responsibility for object creation. Consider giving Class A responsibility for creating objects of Class B if: Class A is an aggregation of Class B (i.e., A consists of B objects) Objects of Class A contain objects of Class B Objects of Class A maintain objects of Class B Objects of Class A frequently use objects of Class B Objects of Class A have the information to create objects of Class B