CS 43111 Overview of CRC CS 4311 B. Beck and W. Cunningham, A Laboratory for Teaching Object-Oriented Thinking, OOPSLA ’89, October 1-6, 1989. R. Wirfs-Brock,

Slides:



Advertisements
Similar presentations
ACM/JETT Workshop - August 4-5, :Design of Classes using CRC cards.
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.
Systems Analysis and Design with UML Version 2.0, Second Edition
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
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.
Systems development life cycle & development methodologies
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
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.
CRC Card By: Yusmadi Yah Jusoh. What is CRC card?  A Class Responsibility Collaborator (CRC) model (Beck & Cunningham 1989; Wilkinson 1995; Ambler 1995)
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
Software Engineering 3 rd Bachelor Informatics Ahmed Lamkanfi October 15, 2009.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Introduction To System Analysis and design
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
OHTO -99 SOFTWARE ENGINEERING LECTURE 5 Today: - An overview to OO Analysis and OO Design - Introduction of Assignment 2.
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
Objects First With Java A Practical Introduction Using BlueJ Designing applications 1.0.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Structural Modeling Chapter 7
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,
Lecture 7: Requirements Engineering
Cohesion and Coupling CS 4311
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Class Diagrams Identifying and representing Classes Object Web, Bapayya Choudhary Maganti.
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
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.
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.
CRC – What is it?  Class  Responsibilities  Collaborations.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
Design Model Lecture p6 T120B pavasario sem.
Designing applications Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns Objects First with Java - A Practical.
1 Class responsibilities & relationships. 2 Responsibilities Responsibilities describe a class’s purpose in terms of its functionality Responsibilities.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Chapter 17 – Object- Oriented Design. Chapter Goals To learn about the software life cycle To learn about the software life cycle To learn how to discover.
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
Chapter 10 요구사항 모델링 : 클래스 기반 방법론 Requirements Modeling: Class-Based Methods 임현승 강원대학교 Revised from the slides by Roger S. Pressman and Bruce R. Maxim for.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
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.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
SWE 4743 Responsibility Driven Design with CRC cards Richard Gesick.
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.
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
Designing applications Main concepts to be covered Discovering classes CRC cards Designing interfaces Patterns © 2017 Pearson Education, Inc. Hoboken,
CRC Cards: Overview Emerson Murphy-Hill Creative Commons Attribution 4.0 License. Material Produced by NCSU Software Engineering Faculty.
Cmpe 589 Spring 2006.
Chapter 5: Structural Modeling
Collaborations and Hierarchies
Object Analysis: Classification
Object-Oriented Analysis
CRC: Classes, Responsibilities, and Collaborations
CRC Modeling (class-relationship-collaborator)
CRC Card Design A CRC Model is a collection of cards (usually standard index cards or larger) that are divided into three sections. 1. Class 2. Responsibility.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

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, B. Wilkerson and L. Wiener, L., Designing Object-Oriented Software, Prentice Hall, (Chapters 3 and 4) Hans Van Vliet, Software Engineering, Principles and Practice, 3 rd edition, John Wiley & Sons, Sections & 12.3.

2 CS 4311 Outline Basics of CRC  CRC Cards  CRC Process Identifying Objects (Classes) Identifying Responsibilities Assigning Responsibilities

3 CS 4311 CRC Cards Invented in 1989 by Kent Beck and Ward Cunningham A simple yet powerful object-oriented (analysis/design) technique Uses a collection of (standard index) cards that are divided into three sections:  Class  Responsibility  Collaborator

4 CS 4311 Class, Responsibility, and Collaborator A class represents a collection of similar objects. A responsibility is anything that a class knows or does. A collaborator is another class that is used to get information for, or performs actions for the class at hand.

5 CS 4311 Example Class: Person Superclass: Subclasses: Student Responsibilities Collaborations Knows name Knows addressAddressBook Knows phone number PhoneBook …

6 CS 4311 More on CRC Cards 3x5 (or 4x6) index cards, post-its, etc. One class per card In addition to CRC, can also write superclasses and subclasses. On the back, can write a description of purpose of the class (with its attributes).

7 CS 4311 Why CRC Cards?

8 CS 4311 CRC Approach – The Process Exploratory phase  Find classes  Determine operations and knowledge for each class (responsibilities)  Determine how objects collaborate to discharge responsibilities Analysis phase  Collect into subsystems

9 CS 4311 How to Find Objects and Their Responsibilities? Use nouns and verbs in requirements as clues  Noun phrases leads to objects  Verb phrases lead to responsibilities Determine how objects collaborate to fulfill their responsibilities  To collaborate, objects will play certain roles Why is this important?  Objects lead to classes  Responsibilities lead to operations or methods  Collaborations and roles lead to associations

10 CS 4311 Outline Basics of CRC  CRC Cards  CRC Process Identifying Objects (Classes) Identifying Responsibilities Assigning Responsibilities

11 CS 4311 Identifying Objects (Classes) Start with requirements specification 1. Look for noun phrases.  Separate into obvious classes, uncertain candidates, and nonsense 2. Refine to a list of candidate classes.

12 CS 4311 Guidelines for Refining Candidate Classes Model physical objects – e.g., disks, printers, geophones. Model conceptual objects – e.g., windows, files, shots, picks. Choose one word for one concept – what does it mean within the domain? Be wary of adjectives – does it really signal a separate class?

13 CS 4311 Guidelines for Refining (Cont.) Be wary of missing or misleading subjects – rephrase in active voice. Model categories of classes – delay modeling of inheritance. Model interfaces to the system – e.g., user interface, program interface. Model attribute values, not attributes – e.g., customer vs. customer address.

14 CS 4311 Example: Mail-Order Software Twice a year the company publishes a catalog of products, which is mailed to customers and other interested people. Customers purchase products by submitting a list of products with payment to the company. The company fills the order and ships the products to the customer ’ s address. The order processing software will track the order from the time it is received until the product is shipped. The company will provide quick service. They should be able to ship a customer ’ s order by the fastest, most efficient means possible. Imagine that you are developing order-processing software for a mail- order company, a reseller of products purchased from various suppliers.

15 CS 4311 Example: Mail-Order Software Twice a year the company publishes a catalog of products, which is mailed to customers and other interested people. Customers purchase products by submitting a list of products with payment to the company. The company fills the order and ships the products to the customer ’ s address. The order processing software will track the order from the time it is received until the product is shipped. The company will provide quick service. They should be able to ship a customer ’ s order by the fastest, most efficient means possible. Imagine that you are developing order-processing software for a mail- order company, a reseller of products purchased from various suppliers.

16 CS 4311 Candidate Classes Nouns and Synonyms software mail-order company, company, reseller products suppliers catalog of products customers, interested people list of products, order, customer’s order payment customer’s address time it is received time products is shipped quick service Candidate Class Name

17 CS 4311 Candidate Classes (Cont.) Expect the list to evolve as design proceeds  Record why you decided to include or reject candidates  Candidate class list follows configuration management and version control

18 CS 4311 A Good Class … Has a clear and unambiguous name Has a name that is recognizable by domain experts Begins with an uppercase letter and is a singular noun Has responsibilities May actively participates in system

19 CS 4311 Outline Basics of CRC  CRC Cards  CRC Process Identifying Objects (Classes) Identifying Responsibilities Assigning Responsibilities

20 CS 4311 What Are Responsibilities? The public services that an object may provide to other objects:  The knowledge an object maintains and provides  The actions it can perform That is,  Convey a sense of purpose of an object and its place in the system  Record services that a class provides to fulfill roles within the system  Record knowledge (maintenance) and manipulation of information in the system

21 CS 4311 Knowledge and Action Knowing responsibilities  Knowing about private encapsulated data  Knowing about related objects  Knowing about things it can derive or calculate Doing responsibilities  Doing something itself, such as creating an object or doing a calculation  Initiating action in other objects  Controlling and coordinating activities of other objects

22 CS 4311 Identifying Responsibilities Use mixtures of: Verb phrase identification. Similar to noun phrase identification, except verb phrases are candidate responsibilities. Scenarios and role play. Perform scenario walk- through of the system where different persons “ play ” the classes, thinking aloud about how they will delegate to other objects. Class enumeration. Enumerate all candidate classes and come up with an initial set of responsibilities. Class relationship examination. Examine all classes and their relationships to compare how they fulfill responsibilities.

23 CS 4311 Example of Verb Phrase Identification Twice a year the company publishes a catalog of products, which is mailed to customers and other interested people. Customers purchase products by submitting a list of products with payment to the company. The company fills the order and ships the products to the customer’s address. The order processing software will track the order from the time it is received until the product is shipped. The company will provide quick service. They should be able to ship a customer’s order by the fastest, most efficient means possible. Imagine that you are developing order-processing software for a mail- order company, a reseller of products purchased from various suppliers.

24 CS 4311 Example of Verb Phrase Identification Twice a year the company publishes a catalog of products, which is mailed to customers and other interested people. Customers purchase products by submitting a list of products with payment to the company. The company fills the order and ships the products to the customer ’ s address. The order processing software will track the order from the time it is received until the product is shipped. The company will provide quick service. They should be able to ship a customer ’ s order by the fastest, most efficient means possible. Imagine that you are developing order-processing software for a mail- order company, a reseller of products purchased from various suppliers.

25 CS 4311 Candidate Responsibilities Verbs and Synonyms Publishes a catalog Is mailed to customers Purchases products; submitting Fills the order Ships the products; is shipped Track the order Is received Provides quick service Candidate Responsibility

26 CS 4311 Group Exercise 1. Based on the requirement specification of the Weather Monitoring System, identify classes by dividing them into the following three categories:  Obvious  Discarded  Unsure 2. Repeat the exercise for candidate responsibilities.

27 CS 4311 Examining Class Relationships To identify more responsibilities Types of relations:  Is-kind-of: super and subclasses  Is-analogous-to: subclasses of same superclass?  Is-part-of: not inheritance

28 CS 4311 Is-kind-of Relationship Often indicates superclass and subclass Try to identify common attributes or actions

29 CS 4311 Is-analogous-to Relationship May indicate superclass and subclass. Look for common or similar responsibilities.

30 CS 4311 Is-part-of Relationship Not superclass and subclass, i.e., the whole need not act like the parts. Need to be careful about assigning responsibilities. Object composed of other objects need to know about its parts.

31 CS 4311 Outline Basics of CRC  CRC Cards  CRC Process Identifying Objects (Classes) Identifying Responsibilities Assigning Responsibilities

32 CS 4311 Assigning Responsibilities Heuristics  H1: Distribute intelligence.  H2: State responsibilities as generally as possible.  H3: Keep behavior with related information.  H4: Keep information about one thing in one place.  H5: Share responsibilities.

33 CS 4311 Heuristics H1: Distribute intelligence. What ’ s intelligence?  Intelligence is what the system knows, actions that it can perform, and impact it has on other systems and users with which it interacts  A class gets intelligence based on how much it knows or can do, and how many other objects it can affect; it often amounts to the number of responsibilities assigned for the class. Why distribute?  To make responsibilities smart.

34 CS 4311 Centralized vs. Distributed Intelligence Centralized control (extreme)  One object would know as much as possible about the system, including flow of control.  All other objects would be devoid of intelligence.  Disadvantages: makes modification difficult; less behavior an object has, more unintelligent classes are needed to implement same system.

35 CS 4311 Centralized Control logic begins and ends here objects hold information

36 CS 4311 Centralized vs. Distributed (Cont.) Distributed intelligence  Each object needs to know relatively fewer things  Produces a more flexible system  Ensure that responsibilities are written at the same level of detail

37 CS 4311 Distributed Control logic begins here logic ends here no one object knows or does much

38 CS 4311 Delegated Control logic begins here logic ends here coordinators manage each step objects knows and do a substep

39 CS 4311 Heuristics (Cont.) H2: State responsibilities as generally as possible. To find common responsibilities that can be shared. To make responsibilities reusable.

40 CS 4311 Heuristics (Cont.) H3: Keep behavior with related information If information changes, no update messages must be sent between objects. The object that needs to know that something has changed will know it. In sum, this makes responsibilities efficient.

41 CS 4311 Heuristics (Cont.) H4: Keep information about one thing in one place. Distribution of information often leads to a duplication, and thus inconsistency. In sum, make responsibilities safe.

42 CS 4311 Heuristics (Cont.) H5: Share responsibilities. A certain responsibility or a compound responsibility can often be best divided or shared among a few closely related objects. In sum, this make responsibilities simple.