CRC – What is it?  Class  Responsibilities  Collaborations.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

1 Introduction to CRC Cards CRC Card = Class Responsibility Collaborator Card Invented in 1989 by Kent Back and Ward Cunningham The CRC Card Book by D.Bellin.
11 Contracts CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 6)
1 Object-oriented design Part 2: OO tools & UML. 2 CRC cards Design tool & method for discovering classes, responsibilities, & relationships Record on.
Visual Basic: An Object Oriented Approach 2 – Designing Software Systems.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
1 Classes. 2 Finding classes w Choosing classes is first step in defining essence of problem w If you can recognize an abstraction, you’ve found a candidate.
Embedded Systems Details. Object Model: Four main system objects or classes Controller object might be made up of several controllers is the brains of.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
ESE Einführung in Software Engineering 4. Responsibility-Driven Design Prof. O. Nierstrasz.
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.
Lecture 4 Class Responsibility Collaboration Cards
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Classes Chapter 4. Terms and Concepts A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.
THE BASICS OF THE WEB Davison Web Design. Introduction to the Web Main Ideas The Internet is a worldwide network of hardware. The World Wide Web is part.
Analysis Modeling. Class-Based Modeling Identify analysis classes by examining the problem statement Use a “grammatical parse” to isolate potential classes.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
The chapter will address the following questions:
Working with Graphics. Objectives Understand bitmap and vector graphics Place a graphic into a frame Work with the content indicator Transform frame contents.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Section 2.1 Identify hardware Describe processing components Compare and contrast input and output devices Compare and contrast storage devices Section.
Requirements Elicitation. Requirement: a feature or constraint that the system must satisfy Requirements Elicitation: specification of the system that.
Rika Yoshii, Ph.D. and Jacquelyn Hernandez CSIS Department California State University, San Marcos Send us suggestions and requests to.
Data Flow Diagrams.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
An Introduction to Visual Basic
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
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.
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
Chapter 18 Object-Oriented Systems Analysis and Design Using UML
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Object oriented classification Classification is the process of checking to see if an object belongs to a category or a class, is regarded as a basic attribute.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Systems Analysis & Design 7 th Edition Chapter 5.
Class Diagrams Identifying and representing Classes Object Web, Bapayya Choudhary Maganti.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 8: Analysis Modeling Software Engineering: A Practitioner’s Approach, 6/e Chapter.
CS Overview of CRC CS 4311 B. Beck and W. Cunningham, A Laboratory for Teaching Object-Oriented Thinking, OOPSLA ’89, October 1-6, R. Wirfs-Brock,
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
GoF: Document Editor Example Rebecca Miller-Webster.
Design Model Lecture p6 T120B pavasario sem.
1 Class responsibilities & relationships. 2 Responsibilities Responsibilities describe a class’s purpose in terms of its functionality Responsibilities.
Repetition af Domæne model. Artifact influence emphasizing the Domain Model.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
Object-Oriented Analysis 2: Finding Classes CMPT 371 Fall 2004 J.W. Benham.
CMSC 202 A Design Exercise. 2 OO design activities Finding the Objects Defining the responsibilities –Services –Attributes Discovering relationships.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
7th Meeting TYPE and CLICK. Keyboard Keyboard, as a medium of interaction between user and machine. Is a board consisting of the keys to type a sentence.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
SWE 4743 Responsibility Driven Design with CRC cards Richard Gesick.
Diagram Editor : Use Case VIew
Diagram Editor Use Case Analysis Assumption: simple stand-alone, single user application. Three basic kinds of interaction of the user with the diagram.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
CHAPTER 6 OBJECT ANALYSIS.
Submitted by: DRPU Software Team Site:
Collaborations and Hierarchies
Object Analysis: Classification
CRC: Classes, Responsibilities, and Collaborations
SYS466 Domain Classes – Part 1.
Understand and Use Object Oriented Methods
Domain Modeling.
Domain Modeling.
ITEC324 Principle of CS III
ITEC324 Principle of CS III
Presentation transcript:

CRC – What is it?  Class  Responsibilities  Collaborations

CRC – What is it?  Classes - a group of objects with similar attributes and methods - DOGS  Object - an instance of a class - SPOT  Attributes - facts belong to an object - SPOT is brown, short hair  Relationships - an association between objects - SPOT to OWNER

CRC – What is it?  Collaboration – Request a service from another object to fulfill a responsibility clientserver Contract

CRC – Phase 1  Find the Objects  Model the domain  What must the system accomplish?  What behavior is clearly outside the system?  For each goal, what kinds of objects are needed to accomplish it?

CRC – Phase 2  Determine their Responsibilities  What does each object have to know in order to accomplish each goal it is involved with?  What steps towards accomplishing each goal is it responsible for?

CRC – Phase 3  Determine Collaborations  With whom will each object collaborate in order to accomplish each of its responsibilities?  What other objects in the system hold knowledge it needs, or know how to perform some operation it requires?  What is the exact nature of the collaborations between the objects?

CRC – Summary  Objects become clients and servers within a system  Responsibilities become contracts between them  Collaborations are a way of determining which clients and which servers are bound by which contracts

CRC – Walk-through  Goal  For a given network, print different kinds of files (Text File, Formatted File, Graphics File) to different kinds of printers (Dot Matrix Printer, Laser Printer)

CRC – Walk-through user :File print :Print Server :Queue :Printer 1:printRequest(printer) 2:add(file) 3:[printer available]getNextFile() 4:print(file) 5:getContents() 6:printContents()

CRC – Walk-through  Classes  File and subclasses Text File, Formatted File, and Graphics File  Printer and subclasses Dot Matrix Printer and Laser Printer  Print Server  Queue

CRC – Walk-through  Responsibilities  File  know how to print itself  know how to send contents to Printer  Print Server  know how to respond to requests to print a file  know the printers on the network  Printer  know how to print the contents of a File  know its printing status  know its printing capabilities  Queue  know how to respond to request to add and remove files  know how many files it contains

CRC – Walk-through  Collaborations  To fulfill print itself, File is a client of Print Server  To fulfill print request, Print Server is a client of Queue and a client of Printer  To fulfill print contents, Printer is a client of File

CRC – Finding Classes  Use Requirements Specification  No requirement specification?  Write down goals of design  Look for noun phrases  Obvious classes/objects  Obvious nonsense (Discard)  Don’t know???

CRC – Finding Classes - Guidelines 1.Model physical objects Disks, printers 2.Model conceptual entities Windows, Files 3.If more than one word is used for the same concept, choose the one that is most meaningful in terms of the rest of the system. 4.Be wary of the use of adjectives. If the use of the adjective in conjunction with the noun implies different object behavior, then make a new class.

CRC – Finding Classes - Guidelines 5.Be wary of sentences in the passive voice, or those whose subjects are not part of the system. 6.Model categories of classes. (Could be abstract superclasses.) 7.Model known interfaces to the outside world. User Interface 8.Model the values of attributes of objects, not the attributes. (Float, Wheel, etc.)

Drawing Editor Example  Hand out Drawing Editor Requirements Specification

Drawing Editor Example  Hand out Drawing Editor Requirements Specification  Find Preliminary Classes  Determine Noun Phrases

Drawing Editor Example List of Preliminary Candidates for Classes drawing editorcursorstop point interactive graphics editorelementline creation tool usercurrent selectionend point drawingcontrol pointrectangle creation tool linetext creation toolrectangle diagonally opposite cornershape of the cursorassociated corner ellipseI-beamellipse creation tool textpositionpoint toolcharactermajor radius mode of operationmouse buttonwidth of the rectangle editortext elementminor radius timecornerheight of the rectangle selection toolregionbounding rectangle creation toolcrosshair drawing elementstart point

Drawing Editor Example 1. Model physical objects Mouse button – Probably an attribute of a mouse or an event

Drawing Editor Example List of Preliminary Candidates for Classes drawing editorcursorstop point interactive graphics editorelementline creation tool usercurrent selectionend point drawingcontrol pointrectangle creation tool linetext creation toolrectangle diagonally opposite cornershape of the cursorassociated corner ellipseI-beamellipse creation tool textpositionpoint toolcharactermajor radius mode of operationmouse buttonwidth of the rectangle editortext elementminor radius timecornerheight of the rectangle selection toolregionbounding rectangle creation toolcrosshair drawing elementstart point

Drawing Editor Example 2. Model conceptual entities  Useful entities – line, rectangle, ellipse, text, character, drawing element, drawing  Tool – composed of selection tool & creation tool (four kinds of creation tool)  Current selection – user manipulates it  Point, Start point, end point, corner (different kinds), major and minor radius, height & width of rectangle, bounding rectangle?????

Drawing Editor Example 3. One word for One concept  Drawing editor, interactive graphics editor, or just editor?  Drawing element or element?  Text or Text Element?  Append Element to line, rectangle, & ellipse.

Drawing Editor Example List of Preliminary Candidates for Classes drawing editorcursorstop point interactive graphics editorelementline creation tool usercurrent selectionend point drawingcontrol pointrectangle creation tool line elementtext creation toolrectangle element diagonally opposite cornershape of the cursorassociated corner ellipse element I-beamellipse creation tool textpositionpoint toolcharactermajor radius mode of operationmouse buttonwidth of the rectangle editortext elementminor radius timecornerheight of the rectangle selection toolregionbounding rectangle creation toolcrosshair drawing elementstart point

Drawing Editor Example 4.Watch out for adjectives  Do selection tool and the various creation tools behave differently?  Rectangle, Bounding Rectangle, Region?  Point, stop point, end point, control point?  Corner, diagonally opposite corner, associated corner?

Drawing Editor Example List of Preliminary Candidates for Classes drawing editorcursorstop point interactive graphics editorelementline creation tool usercurrent selectionend point drawingcontrol pointrectangle creation tool line elementtext creation toolrectangle element diagonally opposite cornershape of the cursorassociated corner ellipse element I-beamellipse creation tool textpositionpoint toolcharactermajor radius mode of operationmouse buttonwidth of the rectangle editortext elementminor radius timecornerheight of the rectangle selection toolregionbounding rectangle creation toolcrosshair rectangle drawing elementstart point

Drawing Editor Example 5.Watch out for sentences with no clear subject  “The current selection is indicated visually by displaying the control points for the element”  Who is displaying the control points for the current selection?  “…the user can create an element of the selected kind.”  Creation tool classes can be regarded as stand-ins for the user

Drawing Editor Example 6.Model Categories  Tool and Creation Tools  Drawing Element

Drawing Editor Example 7.Model Interfaces  User?  User Interface? Yes-part of design phase  Cursor?  Time?

Drawing Editor Example List of Preliminary Candidates for Classes drawing editorcursorstop point interactive graphics editorelementline creation tool usercurrent selectionend point drawingcontrol pointrectangle creation tool line elementtext creation toolrectangle element diagonally opposite cornershape of the cursorassociated corner ellipse element I-beamellipse creation tool textpositionpoint toolcharactermajor radius mode of operationmouse buttonwidth of the rectangle editortext elementminor radius timecornerheight of the rectangle selection toolregionbounding rectangle creation toolcrosshairrectangle drawing elementstart point

Drawing Editor Example 8.Model values of attributes, not attributes themselves  Height of Rectangle, Width of Rectangle?  Major radius, minor radius?  Position?  Mode of Operation?  Shape of the cursor?  Corner?

Drawing Editor Example List of Preliminary Candidates for Classes drawing editorcursorstop point interactive graphics editorelementline creation tool usercurrent selectionend point drawingcontrol pointrectangle creation tool line elementtext creation toolrectangle element diagonally opposite cornershape of the cursorassociated corner ellipse element I-beamellipse creation tool textpositionpoint toolcharactermajor radius mode of operationmouse buttonwidth of the rectangle editortext elementminor radius timecornerheight of the rectangle selection toolregionbounding rectangle creation toolcrosshairrectangle drawing elementstart point

Drawing Editor Example Summary of Remaining Candidate Classes CharacterEllipse Creation ToolRectangle Element Control PointEllipse ElementSelection Tool Creation ToolLine Creation ToolText Creation Tool Current Selection Line ElementText Element DrawingPointTool Drawing EditorRectangle Drawing ElementRectangle Creation Tool

Drawing Editor Example  Record candidate classes on CRC card Class: Drawing

Drawing Editor Example  Finding Abstract Classes  Determine shared behavior  Look for common attributes  Group related classes

Drawing Editor Example Tool Creation Tool Selection Tool Rectangle Creation Tool Line Creation Tool Ellipse Creation Tool Text Creation Tool

Drawing Editor Example  Record superclasses and subclasses Class: Creation Tool Tool Ellipse Tool, Line Tool, Rectangle Tool, Text Tool