GRASP Pattern Zhen Jiang West Chester University

Slides:



Advertisements
Similar presentations
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Advertisements

Object Design Examples with GRASP
Object-Oriented Analysis and Design CHAPTER 17, 25: GRASP PATTERNS 1.
GRASP Patterns M Taimoor Khan
Oct 2, Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
March Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns Assigning responsibilities to objects to achieve user goals Section 17.4.
Feb R. McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
February Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m.
Object-Oriented Software Engineering Practical Software Development using UML and Java Design Patterns Sources: Chapter 6: Using Design Patterns, and Chapter.
Object-Oriented Analysis and Design
GRASP : Designing Objects with Responsibilities
October 20, 2005Architectural Design, ECEN Architectural Design Architecture Business Cycle Design for Maintainability ECEN 5543 / CSCI 5548 SW Eng.
Fall 2009ACS-3913 Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Date: 1753 an interpretation.
Feb 4, Ron McFadyen1 founded on principles of good OO design idea was first put forth by Christopher Alexander (1977) in their work concerning.
CSSE 374: More GRASP’ing and Use Case Realization Steve Chenoweth Office: Moench Room F220 Phone: (812) These.
GRASP Design Patterns: Designing Objects with Responsibilities
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
GRASP Patterns Presented By Dr. Shazzad Hosain. Patterns A pattern describes a problem and solution, and given a name. Examples are Singleton, Adapter,
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
GRASP PATTERNS Information Expert (Expert) Creator Controller © Lethbridge/Laganière 2001 Chapter 6: Using design patterns1.
Chapter 17. GRASP General Responsibility Assignment Software Patterns (Principles) OOD: after identifying requirements, create domain model, define responsiblities.
1 Chapter 17 GRASP Design Patterns: Designing Objects with Responsibilities.
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 )
1 Ch 18. Object Design Examples With Grasp Objectives Design use case realizations. Apply GRASP to assign responsibilities to classes. Apply UML to illustrate.
Chapter 7: Object Design Examples with GRASP. Objective Design use case realizations. Apply GRASP to assign responsibilities to classes. Apply UML to.
BTS430 Systems Analysis and Design using UML Design Patterns.
Chapter 17. Initial Object Design Inputs: requirements meetings various Use Cases – 10% complete Key risks addressed with preliminary programming System.
GRASP: Designing Objects With Responsibilities Chapter 17 Applying UML and Patterns -Craig Larman.
Chapter 18 Object Design Examples with GRASP 1CS6359 Fall 2011 John Cole.
GRASP: Designing Objects With Responsibilities
Object Design Examples with GRASP (Ch. 18)
Object-Oriented Analysis and Design Mar 11, 2008.
17. GRASP—Designing Objects with Responsibilities III CSE5324 Lecture Quiz 17 due at 5 PM Thursday, 8 October 2015.
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 Part 2
Next Gen POS Example GRASP again. Same Patterns Different Example!
GRASP: Designing Objects with Responsibilities
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Object Design and Use- Case Realizations with GRASP Patterns.
What to remember from Chap 13 (Logical architecture)
Object-Oriented Analysis and Design Mar 9, 2008.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
Copyright © Craig Larman All Rights Reserved COMP-350 Object-Oriented Analysis and Design GRASP: Designing Objects with Responsibilities Reference:
GRASP: Designing Objects With Responsibilities
Chapter 17 Designing with Responsibilities. Fig
References: Applying UML and patterns Craig Larman
OO Methodology Elaboration Phase Iteration 1- Part 3.
Design. 2 The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary but not sufficient in order.
Oct 3, Ron McFadyen1 GRASP Patterns 1.Expert 2.Creator 3.Controller 4.Low Coupling 5.High Cohesion.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
OO Methodology Elaboration Phase Iteration 1- Part 2.
Object Design Examples with GRASP
GRASP – Designing Objects with Responsibilities
TK2023 Object-Oriented Software Engineering
TK2023 Object-Oriented Software Engineering
Chapter 12: Collaboration Diagram - PART2
Conception OBJET GRASP Patterns
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
TK2023 Object-Oriented Software Engineering
Presentation on GRASP Patterns Submitted by
Apply Expert, Creator, Controller, Low Coupling, High Cohesion
GRASP : Designing Objects with Responsibilities
GRASP Design Patterns: Designing Objects with Responsibilities
GRASP (General Responsibility Assignment Software Patterns)
Next Gen POS Example GRASP again.
Object Oriented System Design Responsibilities
Design Model: Creating Design Class Diagrams
Presentation transcript:

GRASP Pattern Zhen Jiang West Chester University

Outline Introduction Information Expert Creator Low Coupling High Cohesion Controller

Introduction Design process What’s GRASP pattern What’s responsibility Responsibilities and methods Responsibilities and Interaction Diagrams

Design Process After identifying your requirements and creating a domain model, then add methods to the software classes, and define the messaging between the objects to fulfill the requirements.

What’s GRASP pattern This approach to understanding and using design principles is based on patterns of assigning responsibilities. The GRASP patterns are a learning aid to help one understand essential object design, and apply design reasoning in a methodical, rational, explainable way.

What’s responsibility Doing: – Doing something itself, such as creating an object or doing a calculation – Initiating action in other objects – Controlling and coordinating activities in other objects. Knowing: – Knowing about private encapsulated data – Knowing about related objects – Knowing about things it can derive or calculate

Responsibilities and methods :Sale :Payment makePayment create makePayment implies Sale object has a responsibility to create a Payment object

Responsibilities and Interaction Diagrams Interaction diagrams show choices in assigning responsibilities to objects. GRASP patterns guide choices in where to assign responsibilities. GRASP patterns are a codification of widely used basic principles.

Information Expert Assign a responsibility to the information expert – the class that has the information necessary to fulfill the responsibility. What is a general principle of assigning responsibilities to objects? – Who should be responsible for knowing/doing …? – Domain model (domain expert, domain analysis) to design model (software classes). – Any existing to any representative.

Example: What information is needed to determine the grand total? Sale date Product description price itemID

Sale date Product description price itemID SalesLineItem quantity Who is information expert?

Sale date Product description price itemID SalesLineItem quantity getTotal getSubTotal getPrice

Time sequence?

Creator Who should be responsible for creating a new instance of some class? Creational Design Pattern Assign class B the responsibility to create an instance of class A if one or more of the following is true: – B aggregates A – B contains A – B records instance of A objects – B closely use A objects – B passes initializing data to A

Low Coupling Coupling is a measure of how strongly one element is connected to, has knowledge of, or relies on other elements. Payment, register, and sale. – Time sequence? – Classes?

:Sale :Payment :Register create addPayment makePayment :Payment :Sale :Register makePayment create makePayment

High Cohesion How to keep complexity manageable? Time sequence of the above example. More tasks? Key role, key object, key class, key relations Modular Design (indirect control)

Yin and Yang – The light color area which indicates more sunlight is called Yang (Sun). The dark color area has less sunlight (more moonlight) and is called Yin (Moon). Yang is like man. Yin is like woman. Yang wouldn't grow without Yin. Yin couldn't give birth without Yang. Interdependent influence Trade-off

Controller Assign the responsibility for receiving or handling a system event message to a class representing one of the following choices: – Represents the overall system, device, or subsystem – Represents a use case within which the system event occurs. Who should be the controller for system events such as enterItem and endSale? Which class should be responsible for receiving system event message? Interface layer does not handle system events. The controller receives the service request from the UI layer and coordinates their fulfillment, ie., Command, Façade, and etc.