Lecture 4 Class Responsibility Collaboration Cards

Slides:



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

ACM/JETT Workshop - August 4-5, :Design of Classes using CRC cards.
1 Object-oriented design Part 2: OO tools & UML. 2 CRC cards Design tool & method for discovering classes, responsibilities, & relationships Record on.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
A Linguistics-Based Approach for Use Case Driven Analysis Using Goal and Scenario Authoring Vijayan Sugumaran Oakland University Rochester, Michigan, USA.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
ATM User Interface Design. Requirements A bank customer is able to access his or her account using an automatic teller machine. To be able to use an ATM.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Introduction To System Analysis and Design
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
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.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Documenting Requirements using Use Case Diagrams
Object Oriented Analysis Process
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
Com S 362: Object-Oriented Analysis and Design Class, Responsibilities, Collaborations, CRC Cards Com S 362: Object-Oriented Analysis and Design Oct 18,
The chapter will address the following questions:
Chapter 7: The Object-Oriented Approach to Requirements
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
Introduction To System Analysis and design
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 4 System Models A description of the various models that can be used to specify software systems.
System models Abstract descriptions of systems whose requirements are being analysed Abstract descriptions of systems whose requirements are being analysed.
Business Analysis and Essential Competencies
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
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.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
1 Analysis Extracting from Use Cases to Create Diagrams.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
COMP106 Assignment 2 Proposal 1. Interface Tasks My new interface design for the University library catalogue will incorporate all of the existing features,
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.
System models l Abstract descriptions of systems whose requirements are being analysed.
Systems Analysis and Design in a Changing World, 3rd Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 4: Restaurant.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
Chapter 9 Applying UML and Patterns -Craig Larman
Lecture 6: Structural Modeling
5 Systems Analysis and Design in a Changing World, Fifth Edition.
1 What is OO Design? OO Design is a process of invention, where developers create the abstractions necessary to meet the system’s requirements OO Design.
1 Capturing Requirements As Use Cases To be discussed –Artifacts created in the requirements workflow –Workers participating in the requirements workflow.
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
1 Examining Execution Sequences Introducing Sequence Diagrams.
CSC480 Software Engineering Lecture 8-9 September 20, 2002.
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
22 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 8 Use Case Diagrams.
Lecture 14 22/10/15. The Object-Oriented Analysis and Design  Process of progressively developing representation of a system component (or object) through.
UML (Unified Modeling Language)
UML - Development Process 1 Software Development Process Using UML.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
An informal, team oriented, OO design system
ATM OO Design and Implementation Case Study
OO Domain Modeling With UML Class Diagrams and CRC Cards
Abstract descriptions of systems whose requirements are being analysed
Copyright 2007 Oxford Consulting, Ltd
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

Lecture 4 Class Responsibility Collaboration Cards Object Oriented Analysis and Design K268 SENG2100 Pat Browne Patrick.Browne@comp.dit.ie http://www.comp.dit.ie/pbrowne/ 57 Lecture 2 Fact Finding

Lecture 2 Fact Finding

CRC Object oriented systems are modeled using objects which initially reflect the abstractions identified in the problem domain. CRC cards capture the object model in terms of classes, responsibilities and collaborations, and the class model in terms of subclass and superclass relationships. CRCs are suited to dynamic team work with particular emphasis on role playing. The team member act out the actions of a particular class. CRCs encourage an antropomorphic view. Fact Finding

Class Responsibility Collaboration cards A CRC card is a physical index card that is annotated and used in a group setting to represent a class of objects the behaviour and interactions of both class and object. There is a card for each class, on which we write the responsibilities and other classes collaborated with. Role play during “brainstorming session”. Model three dimensions of a problem. Portable and anthropomorphic. Fact Finding

Class Responsibility Collaboration cards Side 1 Typical Card has: --------------------------------------------- Class name Subclasses Superclasses Responsibilities Collaborators Side 2 has brief textual description of class and its attributes. Fact Finding

Class Responsibility Collaboration cards As with real-world classification, a class groups together objects that the programmer considers to be similar. The class gives the description of a set of objects with similar characteristics and attributes. One class description serves to describe all instances (members) of that class. The class describes the common protocol followed by the individual members (instances). Fact Finding

Class Responsibility Collaboration cards Objects of the same class respond to the same set of messages (the instance protocol), have the same attributes and respond in the same way to each message. (in analysis) A class describes the behaviour of a set of objects of the same kind. What are classes in design and programming? Fact Finding

Class Responsibility Collaboration cards Responsibilities Responsibilities are the information or data that a class maintains and services that it provides. With a bank account these could include to ‘know balance’ or ‘perform credit’ Collaborators A collaborator is is a class whose services are needed to fulfil a responsibility. Fact Finding

Class Responsibility Collaboration cards Collaborators are listed directly across from the responsibilities that they help fulfil. Collaborators may be listed on more than one card if they help fulfil responsibilities for several classes (1:M). Collaborations only exist to fulfil responsibilities. Collaborations will only be listed when one object actually sends a message to its collaborators . Collaborations are modelled as one way communications from initiator class to collaborator , the response is a message answer. Fact Finding

Creating a classes The Classes can be listed as a group before any cards are used. Alternatively, classes can be encountered and created as part of execution of scenarios. New classes may be discovered at any time during analysis. One person should write the names of classes as they are suggested, not much discussion here. When list is complete remove redundancies. Lecture 2 Fact Finding

Creating a classes Use textual analysis techniques. How about user-interface design? Filtering Classes: classes examined more closely e.g. Book class could be defined as the set of objects that represent books borrowed from a library. Lecture 2 Fact Finding

Assigning Cards After filtering, classes are assigned to cards. Each participant takes an index card which they annotate with the class name and check for agreement. Annotate side 2. Lecture 2 Fact Finding

Assigning Subclass/Superclass Only obvious subclass/superclass relations should be developed at this stage. Lecture 2 Fact Finding

Responsibilities/Attributes We can now assign behaviours. Attributes can be identified by reading the negotiated statement of requirement. Nouns that are not classes but characteristics of classes are best represented as attributes (e.g. the Book class may have a ‘known due date’ attribute). Lecture 2 Fact Finding

Scenarios Next follows a set of walk-throughs of the relevant scenarios from the application area. Scenarios are detailed examples of functions of the system. They describe what happens in the system from a high level point of view. For example in a library: checking out an item, returning an item, searching for an item. A generic scenario is sometimes called a use case. Lecture 2 Fact Finding

Scenarios The simulation for the scenario should be dynamic and anthropomorphic. The cards on the table are static classes. When the cards are held they represent dynamic objects. While executing a scenario the team should be holding the relevant cards. Raising and lowering cards provides visual clues about execution. Note related scenarios. Lecture 2 Fact Finding

CRC uses CRC used during: Can also be used to: Analysis: Looking at problem domain. Design: Refining responsibility. Can also be used to: Select core classes Act out class relationships and scenarios Refine project requirement. Assist project management(giving a idea of the number and complexity of the required classes) Serve as a guide to coding (to some degree) Fact Finding

CRC uses Role play during “brainstorming session”. Model three dimensions of a problem CRC.  Analysis: Exploring at problem domain Design: Refining responsibility. Lecture 2 Fact Finding

CRC session The Classes can be listed as a group before any cards are used. Alternatively, classes can be encountered and created as part of execution of scenarios. New classes may be discovered at any time during analysis. One person should write the names of classes as they are suggested, not much discussion here. When list is complete remove redundancies. Use textual analysis as described. Lecture 2 Fact Finding

CRC session Filtering Classes: classes examined more closely e.g. Book class could be defined as the set of objects that set that represent books borrowed from a library After filtering classes are assigned to cards. Each participant takes an index card which they annotate with the class name and check for agreement. Annotate side 2. Lecture 2 Fact Finding

CRC session Only obvious subclass/superclass relations should be developed at this stage. Assigning behaviours. Attributes can be identified by reading the negotiated statement of requirement. Nouns that are not classes but characteristics of classes are best represented as attributes (the Book class may have a ‘known due date’ attribute). Lecture 2 Fact Finding

CRC session Next follows the walk-throughs (scenarios) of the application area. Scenarios are detailed examples of functions of the system. They describe what happens in the system from a high level point of view. For example in a library: checking out an item, returning an item, searching for an item. Lecture 2 Fact Finding

CRC session The simulation for the scenario should be dynamic and anthropomorphic. The cards on the table are static classes. When the cards are held they represent dynamic objects. While executing a scenario the team should be holding the relevant cards. Physically raising and lowering cards provides visual clues about execution. This promotes an anthropomorphic view of classes and objects. Note related scenarios   Lecture 2 Fact Finding

A quick look at UML use cases Use cases describe the behaviour of a system from a user's standpoint by using actions and reactions. They facilitate the definition of the system's boundary, and the relationships between the system and the environment. A use case diagram consists of an actor linked with one or more uses cases. A use case corresponds to a specific kind of system use. It is an image of a system's functionality, which is triggered in response to the stimulation of an external actor. Use cases have good support tools and standard UML notation Use case is well integrated into RUP. Lecture 2 Fact Finding

CRC and use cases. Use cases alone are not sufficient to build systems; · developers may focus use cases losing sight of class structure and architecture. ·  mistaken design for requirement, user requirement may be improved by design. ·   missing a requirement, not all requirements can be found by identifying actors. and their associated use case. Lecture 2 Fact Finding

CRC and use cases. The examination of use cases on its own is not a good way to find objects and classes. A class model is also required, techniques such as CRC cards are still useful. For example, a customer may never directly interact with a sales system (say its done by a sales person), however a customer would certainly be a class in a sales system. Also other concepts such as architecture need to be developed. Lecture 2 Fact Finding

CRC and use cases. With the emphasis on interaction and anthropomorphism CRC are more appropriate for team collaboration. CRC can be used to develop both the class diagram (structural model) and the sequence diagram (dynamic model). Use case focus more on the requirements from the actors perspecitve. Lecture 2 Fact Finding

Case study (Requirement) A bank plans a new to build ATM system using OO methods. The ATM system will interface with the customers through a display screen, numeric and special input keys, a bank card reader, a deposit slot, and a receipt printer. Customers may make deposits, withdrawals, and balance enquiries using the ATM machine but the update of acounts will be handled by an interface to the Accounts system. Customers will be assigned a PIN and a clearance level by the Security system which can be verified prior to transactions. In the future we would also like to allow customers to update routine information such as change of address or phone number using the ATM. Fact Finding

ATM candidate classes ATM Financial Tranasction CashDispencer Screen Message Display Fact Finding

Lecture 2 Fact Finding

Lecture 2 Fact Finding

Lecture 2 Fact Finding

CRC Summary Class A class describes the behaviour of a set of objects of the same kind. The class is essential when acting out scenarios. Responsibilities are the knowledge that a class maintains and services that it provides. Again when acting out scenarios analyst must be able to develop or know the current responsibilities of a class. Collaborators A collaborator is is a class whose services are needed to fulfil a responsibility. Fact Finding

CRC Summary Use of card during development High level description of role at different stages: 1) Analysis: Exploring at problem domain 2) Design: Refining responsibility. Fact Finding

CRC Summary Use of card during development Details of usage: Teams can use the CRC technique to accomplish a variety of tasks, including: Initially discovering classes Selecting the core classes Acting out class relationships and scenarios or role play during “brainstorming session”. Refining the project requirements Furthering project management, can be used to estimate the number of classes required. Serving as a guide to the design of code. Fact Finding

CRC on the web For further information see: http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/crc_b/ http://c2.com/doc/oopsla89/paper.html http://www.extremeprogramming.org/rules/crccards.html http://alistair.cockburn.us/crystal/articles/ucrcc/usingcrccards.html Fact Finding