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

Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Object-Oriented Analysis and Design
Ch 12: Object-Oriented Analysis
CS3773 Software Engineering Lecture 03 UML Use Cases.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Systems Analysis and Design in a Changing World, Fourth Edition
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.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Lecture 4 Class Responsibility Collaboration Cards
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
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 Case Study Slide 1 Introductory case study.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
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.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
Case Study :. Introduction The ATM network will consist of a large number of ATM machines distributed over a wide geographical area. The network must.
Systems Analysis and Design in a Changing World, Fifth Edition
Introduction To System Analysis and Design
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
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.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
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.
Chapter 12: Design Phase n 12.1 Design and Abstraction n 12.2 Action-Oriented Design n 12.3 Data Flow Analysis n Data Flow Analysis Example n
1 Responsibility Driven Design Responsibility Driven Design, Rebecca Wirfs Brock, 1990 The Coffee Machine Design Problem, Alistair Cockburn, C/C++ User's.
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.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
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.
1 By Rick Mercer with help from Object-Oriented Design Heuristics, Arthur Riel Coupling / Cohesion.
Use Case Textual Analysis
Systems Analysis and Design in a Changing World, Fourth Edition
Outline Derive some user stories for next Project
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
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.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Object Oriented Analysis & Design By Rashid Mahmood.
Chapter 3: Software Design –Use case Diagram Nouf Alghanmi.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
Object Design Examples with GRASP
Relationships amongst Objects
Chapter 11: Collaboration Diagram - PART1
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)
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 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 25 Sequence Diagrams ♦Interaction diagrams describe how groups of objects collaborate in some behavior ♦The UML defines several forms of interaction diagram, the most common is the sequence diagram ♦A class diagram shows a fixed view of a system ♦A sequence diagram represents a dynamic view of a system by capturing message sends over time ♦Can document a scenario such as ‒ Dealer deals cards to all players ‒ Withdraw Money when there is enough balance ‒ Withdraw Money when there is not enough balance

16 26

17 27 Sequence Diagrams ♦Not good at showing details of algorithms such as loops and conditional ♦Good at showing the calls between participants ♦Gives a good picture about which participants are doing which processing

18 28 More Distributed Control Shown here

19 29 Syntax ♦Objects are lined up on top in rectangles ♦Dashed lines represent lifetime of objects ♦Rectangles are activation lines ♦When the object is "alive" ♦Activation bar of the receivers of the message is smaller than the sender's activation bar ♦Not much detail written

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

21 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