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.

Slides:



Advertisements
Similar presentations
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advanced Piloting Cruise Plot.
Kapitel S3 Astronomie Autor: Bennett et al. Raumzeit und Gravitation Kapitel S3 Raumzeit und Gravitation © Pearson Studium 2010 Folie: 1.
Kapitel 21 Astronomie Autor: Bennett et al. Galaxienentwicklung Kapitel 21 Galaxienentwicklung © Pearson Studium 2010 Folie: 1.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
Document #07-12G 1 RXQ Customer Enrollment Using a Registration Agent Process Flow Diagram (Switch) Customer Supplier Customer authorizes Enrollment.
Document #07-12G 1 RXQ Customer Enrollment Using a Registration Agent Process Flow Diagram (Switch) Customer Supplier Customer authorizes Enrollment.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Determine Eligibility Chapter 4. Determine Eligibility 4-2 Objectives Search for Customer on database Enter application signed date and eligibility determination.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
ACM/JETT Workshop - August 4-5, :Design of Classes using CRC cards.
11 Contracts CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 6)
ABC Technology Project
By Waqas Over the many years the people have studied software-development approaches to figure out which approaches are quickest, cheapest, most.
VOORBLAD.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
main idea and supporting details
Squares and Square Root WALK. Solve each problem REVIEW:
Do you have the Maths Factor?. Maths Can you beat this term’s Maths Challenge?
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Systems Analysis and Design with UML Version 2.0, Second Edition
OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling  O-O Programming ► similar conceptual.
Executional Architecture
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
25 seconds left…...
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Improving Achievement
A SMALL TRUTH TO MAKE LIFE 100%
PSSA Preparation.
Chapter 11 Component-Level Design
McGraw-Hill©The McGraw-Hill Companies, Inc., 2001 Chapter 16 Integrated Services Digital Network (ISDN)
Modeling Main issues: What do we want to build How do we write this down.
Object-Oriented Analysis and Design
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Problem Solving and Algorithm Design
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Algorithms and Problem Solving-1 Algorithms and Problem Solving Mainly based on Chapter 6: “Problem Solving and Algorithm Design” from the Book: “Computer.
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
Chapter 6 Problem Solving and Algorithm Design Nell Dale John Lewis.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
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 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,
CRC – What is it?  Class  Responsibilities  Collaborations.
1 Class responsibilities & relationships. 2 Responsibilities Responsibilities describe a class’s purpose in terms of its functionality Responsibilities.
SWE 4743 Responsibility Driven Design with CRC cards Richard Gesick.
An informal, team oriented, OO design system
Class diagram Description
Object-Oriented Design
CRC: Classes, Responsibilities, and Collaborations
Presentation transcript:

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 and S.Simone. Pub: Addison Wesley, ISBN:

2 CRC Cards: Help explore objects Provide an easy' introduction Starting point of many methodologies Used in industry Widely used in teaching

3 Format of CRC CARDS (1) A CRC card contains the following information:

4 Format of CRC CARDS (2) Index cards Post-It notes Walls/Whiteboards/Desks String and Blu-tack

5 FINDING CLASSES Method: 1. Read specification 2. Work through requirements, highlighting nouns and noun phrases to give candidate classes. 3.Work through candidates, deciding likely classes and rejecting unlikely.

6 READ SPECIFICATION If you don't have one, WRITE your own. The specification should: –describe the goals of the design –discuss the things the system should do i.e. desired responses to expected inputs

7 HIGHLIGHTING NOUN PHRASES convert plurals to singulars discard obvious nonsense classes (but keep all rest) remove synonyms (but keep BEST descriptor) beware adjectives (they can be irrelevant, but can mean a whole new class exists) beware hidden nouns e.g. passive voice "the thing is activated" = "SOMETHING activates the thing"

8 CANDIDATE CLASSES physical objects e.g. printer, switch cohesive entities e.g. file, window categories of classes (may become abstract superclasses) interfaces both to user and to other programs attribute values (NOT attributes) e.g. "circle has radius in real numbers" : circle and real are classes; radius is not.

9 FINDING CLASSES The process of identifying classes is iterative - some will be missed, others will be amalgamated Likely classes: –any physical objects –any 'cohesive abstractions' e.g. a file –any interfaces to outside world –any categories of class e.g. "there are various types of whatsits" –values of attributes of objects

10 FINDING CLASSES Problems: Warnings –adjectives –passive voice e.g. they travelled to the seaside Reject: –attributes –nouns that are really verbs e.g. the chance of throwing a six is 1/6 –objects outside system

11 IDENTIFYING RESPONSIBILITIES Responsibilities are concerned with: –the maintenance of knowledge –the actions the object can perform Technique: 1. Highlight verbs/phrases in requirements 2. Do walkthroughs 3. Spread intelligence 4. Keep behaviour and knowledge close

12 What are Responsibilities? They contain two key items: –the knowledge that the object maintains –the actions the object can perform They say WHAT gets done, not HOW its done

13 Identifying Responsibilities Read requirements & highlight: –verbs –information (which some object must maintain) Check these are actions that a system object must perform Try a walkthrough –try anthropomorphism/personification Check all your classes are doing something useful

14 Assigning Responsibilities evenly distribute system intelligence state responsibilities as generally as possible keep behaviour with related information (if any) keep information about one thing in one place share responsibilities among related objects

15 Look at Relationships between Classes Taking classes from within your system, see if there are examples of: is-kind-of –maybe superclass should have responsibility? is-analogous-to –if have similar responsibilities, perhaps should be common superclass with it? is-part-of –therefore clarify responsibilities between parts of an aggregate class

16 Difficulties Missing classes –perhaps worth encapsulating unassigned responsibilities to a new class? Uncertain Assignment of Responsibilities –i.e. maybe one responsibility could go to two different classes –solve by walkthrough?

17 COLLABORATIONS A collaboration is where one class (a client) needs another one (a server) in order to perform its own responsibilities. –NB this is a one-way relationship Each responsibility may have: –no collaborations –one collaboration –many collaborations

18 FINDING COLLABORATIONS (1) Using CRC cards, work through ALL responsibilities identifying collaborators;. Therefore, for each responsibility ask: –can the class do it alone? –if not: what knowledge does it need? what processing does it need? which classes have what it needs?

19 FINDING COLLABORATIONS (2) For each CRC card class ask: –what does it do or know? –what classes need this service or knowledge? –are those classes collaborating with this class? Confirm by looking at classes and ensure if a class does/knows something, it is being used

20 Examine Relationships (1): Collaboration is strongly indicated by: –has-knowledge-of e.g. a car needs to know the speed limit, which it gets from the sign on the side of the road or... –depends-on (changes-with)e.g. pressing accelerator increases speed of wheels and decreases petrol level (but beware INDIRECT collaborations) –(composite) is-part-of e.g. to turn a car, the car will need to send messages to its steering wheel, wheels

21 Examine Relationships (2): Collaboration is not necessarily indicated by container (is-part-of ) aggregation For example an array holds a group of elements but doesnt usually collaborate with them as it doesnt need to know their values or use any of their methods.

22 CRC CARDS Additional information:

23 CRC Terms versus UML Terms CRC are similar to classes, but are treated like objects attributes are the same in both CRC and UML responsibilities are operations Superclass and subclass describe inheritance relations Collaborators are associations

24 Brainstorming All ideas are potential good ideas Think fast and furiously first, ponder later Give every voice a turn A little humour can be a powerful force Use a Round-Robin technique Discuss and select (from Bellin and Simone, 1997)

25 From Bennett el al: Working in groups of 4 half the groups brainstorm Q8.2 and produce an OHP, other half brainstorm Q8.3 and produce an OHP. Present to class.

26 Working in groups try in ways suggested by others if stuck/arguing, defer decision to later try "flexible visualisation do a Walk Through Try personification/anthropomorphism!

27 From Bennett el al: Read FoodCo transcript p120 Working in groups of 4 produce CRCs for FoodCo based on the transcript