Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

The CRC Card

Exercise

Java Boot Camp


OOP Concepts and Java Fundamentals

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Objectives
 To think in an object-oriented manner
 To use a responsibility-driven approach to
object-oriented development
 To develop a Domain Model through the
exercise

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
A typical CRC card

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
What is CRC
 Contains
 Classes
 Responsibilities
 Collaborators

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Classes
 Find all the nouns and verbs in the problem
statement
 Nouns are a good key as to what classes are
in the system
 Verbs show the responsibilities
 One class per card

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Superclasses and
Subclasses
 Can be defined at any time they become
obvious
 They may be defined immediately or may
wait until the scenario does this.

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Responsibilities
 The tasks the class is required to handle
 Add the obvious
 From the requirements
 From the name of the class

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Collaborators
 Identify the classes that cooperate with
each other to provide a needed service.
 They help the class under study (the one
on the card) fulfill its responsibilities.

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
The CRC Exercise
 This CRC exercise that will be played out is
a simplification of the actual process for
purposes of helping you understand how
to design a domain model and define the
object interactions.
 For our exercise the card will hold only the
class name.

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
The CRC Exercise
 Exercise Objectives:
 Part 1: Design the static structure of a system,
the Domain Model
 Part 2: Develop an understanding of how the
elements of the Domain Model interact by
means of roleplay.

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Exercise Application
 <Application specs for the inter-University
cross-enrollment system will be inserted
here>

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
The CRC Exercise
 Part 1: Design the static structure of a
system, the Domain Model
 Create a class for each of the business entities
that you expect to use in the system.
 Identify the relationships, if any, of the
business entitied you defined.

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
The CRC Exercise
 Part 2: Develop an understanding of how
the elements of the Domain Model interact
by means of roleplay.
 Each object will be roleplayed by one person.

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved
Acknowledgements
 Reflections on CRC cards for OO design
 http://www.cs.umu.se/~jubo/Meetings/OOPSLA01/Contributions/RBiddle.html

 Object oriented analysis and design using


CRC cards
 http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/crc_b/

Copyright 2008 Orange & Bronze Software Labs Ltd.Co. All Rights Reserved

You might also like