1 Responsibility Driven Design Responsibility Driven Design, Rebecca Wirfs Brock, 1990 The Coffee Machine Design Problem, Alistair Cockburn, C/C++ User's.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Ch 12: Object-Oriented Analysis
CS3773 Software Engineering Lecture 03 UML Use Cases.
Information System Design IT60105
Lecture 9 Object-Oriented Analysis
Chapter 18 Object-Oriented Systems Analysis and Design Using UML
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Lecture 4 Class Responsibility Collaboration Cards
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Lecture 5 Responsibility-Driven Design
Requirements Analysis 4. 1 Use Case I b504.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Use-Cases.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Software Engineering 3 rd Bachelor Informatics Ahmed Lamkanfi October 15, 2009.
Introductory case study. 2 The problem The most difficult part of any design project is understanding the task you are attempting You have been contacted.
Software Engineering Case Study Slide 1 Introductory case study.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Chapter 7: The Object-Oriented Approach to Requirements
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
Chapter 17. GRASP General Responsibility Assignment Software Patterns (Principles) OOD: after identifying requirements, create domain model, define responsiblities.
Chandan Rupakheti Office: Moench Room F203 Phone: (812) These slides and others derived from Shawn Bohner, Curt.
1 Responsibility Driven Design Responsibility Driven Design, Rebecca Wirfs Brock, 1990 The Coffee Machine Design Problem, Alistair Cockburn, C/C++ User's.
Requirements Determining the requirements of software involves determining the needs of the users of the software. Determining the requirements of software.
Introduction To System Analysis and Design
1 Object-Oriented Analysis Use Case Driven. 2 The outline method for OOA 1.Identify object classes within the problem domain 2.Define the behaviour of.
1 Analysis Extracting from Use Cases to Create Diagrams.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
CRC CARDS 1 Sys464 Object-oriented analysis and design.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Object-Oriented Design Part 2
Understanding Objects and Classes
1-1 User Stories Much taken from User Stories Applied: For Agile Software Development Mike Cohn Mountain Goat Software.
Notes of Rational Related cyt. 2 Outline 3 Capturing business requirements using use cases Practical principles  Find the right boundaries for your.
GRASP: Designing Objects with Responsibilities
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
CSC172 Class Design Pepper. Goals How to design classes How to think in terms of objects StarUML Code Generation.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
1 By Rick Mercer with help from Object-Oriented Design Heuristics, Arthur Riel Relationships amongst Objects.
1 Software Development By Rick Mercer with help from these sources: Rational Unified Process Computing Fundamentals with C++, Rick Mercer Designing Object.
Design Model Lecture p6 T120B pavasario sem.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
1 By Rick Mercer with help from Object-Oriented Design Heuristics, Arthur Riel Coupling / Cohesion.
Use Case Textual Analysis
Outline Derive some user stories for next Project
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
8-1 By Rick Mercer with help from Object-Oriented Design Heuristics Arthur Riel Addison-Wesley, 1996, ISBN X Relationships amongst Objects.
1 Responsibility Driven Design Responsibility Driven Design, Rebecca Wirfs Brock, 1990 The Coffee Machine Design Problem, Alistair Cockburn, C/C++ User's.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
1 Jukebox Objects. 2 Outline  Design a solution as a set of candidate objects with well-defined responsibilities — Compare your objects to Rick’s  Role.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
GRASP – Designing Objects with Responsibilities
Relationships amongst Objects
Introduction to Unified Modeling Language (UML)
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
OO Domain Modeling With UML Class Diagrams and CRC Cards
Outline Derive some user stories for next Project
Introduction to Unified Modeling Language (UML)
Introduction to Unified Modeling Language (UML)
Copyright 2007 Oxford Consulting, Ltd
On to Object Design c. 14.
Presentation transcript:

1 Responsibility Driven Design Responsibility Driven Design, Rebecca Wirfs Brock, 1990 The Coffee Machine Design Problem, Alistair Cockburn, C/C++ User's Journal, May and June Introducing Object-Oriented Design with Active Learning, Rick Mercer, Consortium for Computing in Small Colleges, 2000

2 In Rebecca Wirfs Brocks' Words Responsibility-Driven Design is a way to design that emphasizes behavioral modeling using objects, responsibilities and collaborations. In a responsibility-based model, objects play specific roles and occupy well-known positions in the application architecture. Each object is accountable for a specific portion of the work. They collaborate in clearly defined ways, contracting with each other to fulfill the larger goals of the application. By creating a "community of objects", assigning specific responsibilities to each, you build a collaborative model of our application. Responsible : able to answer for one's conduct and obligations—trustworthy, Merriam Webster

3 Responsibility Driven Design in Rick's words 1. Identify candidate objects that model a system as a sensible set of abstractions 2. Determine the responsibility of each object — what an instance of the class must be able to do, — and what each instance must know about itself 3. Understand the system through role play — To help complete its responsibility, an object often needs help from other objects

4 OO Design Principle The Single Responsibility Principle Classes should have a single responsibility  Why? — Cohesion, when high, reduces complexity, makes the system more understandable — Maintenance: Fixing or changing a module should not break other parts of the system

5 First Design a Model Note: design is iterative  Find a set of objects (candidate classes) that model a solution  Each will be a part of the bigger system  Each should have a single responsibility  What are these objects?

6 Find the Objects  Candidate objects may come from — An understanding of the problem domain knowledge of the system that the problem specification may have missed or took for granted — The words floating around the room Alistair Cockburn — The nouns in the problem statement Underline the noun phrases to look for the objects that could model the system

7 The student affairs office want to put some newfound activity fee funds toward a Jukebox in the student center. The Jukebox must allow students to play a song. No money will be required. Instead, a student will swipe a magnetic ID card through a card reader, view the song collection and choose a song. Students will each be allowed to play up to 1500 minutes worth of "free" Jukebox music in their academic careers, but never more than two songs on any given date. No song can be played more than five times a day*. *What a drag it would be to hear "Dancing Queen" 14 times while eating lunch ( apologies to ABBA) The Problem Specification repeated

8 A First Cut at the Candidate Objects (may become classes) What objects effectively model the system? What is the responsibility, Example Song: Know song title, artist, playtime, how often it's been played today Others?

9 Yesses Jukebox : coordinates activities one instance to start things and keep them going JukeboxAccount changed from Student : maintain one account: model user who play songs Song : one song that can be played CardReader : reads the magnetic ID card

10 A No StudentIdCard : store user data Object-Oriented Design Guideline Eliminate classes that are outside the system — The hallmark of such a class is one whose only importance to the system is the data contained in it. — Student identification number is of great importance — The system should not care whether the ID number was read from a swiped magnetic ID card, typed in at the keyboard, or "if a squirrel arrived carrying it in his mouth" Arthur Reil

11 More Candidate Objects?  SongCollection : songs to choose from  What about storing a collection of accounts? JukeBoxAccountCollection  Use a compact disk player or real Jukebox?  Could have a software equivalent like SongPlayer to play audio files?

12 Date Date : Can determine when a song is played and the current date. — Maybe — Can we use use java.util.GregorianCalendar?

13 Another No? StereoSystem : Amplifies the music — No, it's on the other side what we have to build  The next slide summarizes some needed candidate objects — It also sets the boundaries of the system There are model of the real world objects

14 Candidate Objects and the system boundary Rick drew this before UML existed CardReader Gets student ID JukeboxAccountCollection Stores all JukeboxAccount objects JukeBox Coordinates activities SongPlayer Plays a song SongCollection Stores all Songs that can be played JukeboxAccount Song

15 30 Another Example Scenario: The user tries to use an ATM, but the account is not known

16 Role Play  Need 7 students to play the role play the scenario Rick wants to play “Feelin’ Alright” 1. CarderReader 2. JukeboxAccountCollection 3. JukeBoxAccount 4. Jukebox 5. Songplayer 6. SongCollection 7. Song The rest of you will have to write a sequence Diagram by hand, it will be like taking notes, a start