Chapter 17. Initial Object Design Inputs: requirements meetings various Use Cases – 10% complete Key risks addressed with preliminary programming System.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design
Advertisements

Object-Oriented Analysis and Design CHAPTER 17, 25: GRASP PATTERNS 1.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Chapter 25 GRASP: More Objects with Responsibilities 1CS6359 Fall 2011 John Cole.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
NJIT More GRASP Patterns Chapter 22 Applying UML and Patterns Craig Larman Prepared By: Krishnendu Banerjee.
NJIT 1 GRASP: Designing Objects with Responsibilities Chapter 17 Applying UML and Patterns Craig Larman.
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.
Chapter 25 More Design Patterns.
GRASP Design Patterns: Designing Objects with Responsibilities
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
GRASP Pattern Zhen Jiang West Chester University
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
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.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
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 )
BTS430 Systems Analysis and Design using UML Design Patterns.
Object-Oriented Analysis and Design Mar 2, 2009.
GRASP: Designing Objects With Responsibilities
Object-Oriented Analysis and Design Mar 11, 2008.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
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
Copyright © Craig Larman All Rights Reserved Responsibility-Driven Design with the GRASP Patterns.
Object-Oriented Design Part 2
Next Gen POS Example GRASP again. Same Patterns Different Example!
CSSE 374: More GRASP’ing for Object Responsibilities
GRASP: Designing Objects with Responsibilities
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
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.
Patterns Roberto Damiani Mendes. Roteiro Definition; Definition; Architecture Patterns; Architecture Patterns; Design Patterns; Design Patterns; GRASP.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
Advanced Object-Oriented Design Patterns and Architectures Part One COEN396A John Xiao
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
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
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.
GRASP: More Patterns for Assigning Responsibilities Presented By Dr. Shazzad Hosain.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
Object Design Examples with GRASP
GRASP – Designing Objects with Responsibilities
BTS530: Major Project Planning and Design
TK2023 Object-Oriented Software Engineering
GoF Patterns (GoF) popo.
Chapter 12: Collaboration Diagram - PART2
Conception OBJET GRASP Patterns
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)
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
Chapter 25 GRASP The other four.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Chapter 25 GRASP The other four.
Next Gen POS Example GRASP again.
Object Oriented System Design Responsibilities
Presentation transcript:

Chapter 17

Initial Object Design Inputs: requirements meetings various Use Cases – 10% complete Key risks addressed with preliminary programming System Sequence Diagrams The Domain Model Glossary Use Case post-conditions clarify proposed achievements.

Object Design Activities: Test-first development (test code production code) Some UML modeling Sequence Diagrams concurrent with Class Diagrams Apply GRASP principles and GoF Design Patterns Follow RDD – responsibility-driven design Class diagrams are intended for understanding, not documentation

Object Design Outcome: Add methods to appropriate classes. This simplistic description hides the deep principles and issues involved and he consequences of getting it wrong.

Fig inputs and outputs of a day of design

Responsibility-Driven Design (RDD): Think in terms of responsibilities, roles and collaborations Two kinds: – doing – knowing Think about responsibility “granularity” Responsibilities happen in conjunction with collaborations between objects.

Responsibility-Driven Design (RDD): Doing: –doing something itself –initiating action in others –controlling or coordinating activities across various objects

Responsibility-Driven Design (RDD): Knowing: –knowing about private data –knowing about related objects –knowing about secondary data it can calculate (result of a method call)

Guidelines: Domain Model guides what classes “know” Results in “low representational gap” keep your eye on responsibility “granularity” –big responsibilities get spread over many classes –small responsibilities may take only one method Collaboration is everywhere – methods talk to one another

RDD as Metaphor: An OO Design seen as a community of collaborating responsible objects.

GRASP: General Responsibility Assignment Software Patterns or Principles Basic principles to follow when assigning responsibilities Used in place of experience based on recognized successful patterns

GRASP Principles: Information Expert: assign responsibility to the knowledgeable class; the one with the necessary info Creator: Creation responsibility goes to the class that –contains an object –aggregates an object –has initializing data Controller: A class that represents the overall system, “root”, a device, a subsystem or a Use Case goal. This is the first class beyond the UI. Low Coupling: Keep unnecessary coupling to a minimum. Typically one of many alternatives.

GRASP Principles: High Cohesion: assign responsibility so cohesion remains high. Typically one of many alternatives. Polymorphism: Assign responsibilities as behaviour varies by type. Use polymorphism. Pure Fabrication: When a highly cohesive set of behaviours needs a home and no domain object does it. Indirection: Use an intermediate object when you don't want to classes to know about each other. Protected Variations: Protecting against instability if variations need frequent tweaking. Identify places of predictable instability and protect them with an interface.

Fig What GRASP principles are applied here?

Patterns: A pattern is a named description of a problem and its solution that can be applied to new contexts. Naming a pattern is important. If you can't name it you don't understand it. Patterns are all old friends. Keep to the tried and true. “New” pattern is an oxymoron. Own the GoF book – Design Patterns

Fig What GRASP patterns are in use?

Fig Board aggregates Square. Start there.

Find the GRASP patterns in use here: Creator: Board creates Square (LRG) since it aggregates squares. Information expert: To retrieve one square one needs to know about all squares. This is Board's job as aggregator. Low Coupling: Knowing about squares as a collection and then individually means low coupling. Controller: High Cohesion:

Fig. 17.4

Fig. 17.6

Find the GRASP patterns in use here: Low Coupling: Knowing about squares as a collection and then individually means low coupling. Controller: High Cohesion:

Fig. 17.7

Fig. 17.8

Fig. 17.9

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig

Fig