Professional Documents
Culture Documents
V4.0
October 2015
Ferreiras
2
Overview of CRC cards
There are two types of responsibilities for
a class:
3
Overview of CRC cards
There are two types of responsibilities for a
class:
1.
2. Doing ( behavior, methods )
Deriving or calculating something
Knowing which other objects can do
things.
How to coordinate with other object that do
things.
These abilities are usually performed as
methods
4
Overview of CRC cards
Simulating program run:
5
Overview of CRC cards
Recording class responsibility:
List the responsibilities as succinctly as possible.
An appropriate phrase (eg: know, maintain,
compute, calculate, display, prompt, read,
provide etc) correctly used conveys the meaning of
the responsibility.
A class should not have a large number of
responsibilities.
6
Overview of CRC cards
Recording a class responsibility:
If the responsibilities cannot be fitted into one
card, it is time to re-think the design:
May be you have included too much detail
(may be you an find a phrase that briefly
conveys the meaning of the responsibility)
May be the class is doing too many things
(time to break up the class into several
classes)
May be some of the responsibilities are
already listed for the super class.
7
Overview of CRC cards
Recording a class collaborator:
A class may have all the data (as data
members) needed to fulfill a responsibility; Or,
Knows other classes that have the rest for
fulfill its responsibility. Then those classes
are identified as collaborators.
From a class perspective, the philosophy is
What I know and Who I know to fulfill a
responsibility.
8
Overview of CRC cards
After you have identified all the classes ( attributes
and operations) that are needed so that your little
software do all the work for which it was created:
9
Overview of CRC cards
Please read carefully:
This activity (writing the CRC cards) is very important for the success
of your software project; Here you will demonstrate that you have
total control of computational solution of the problem.
Good luck !!
10
CRC Card, ATM, Simplified Example
CRC Card
<<ClassName>>
SYSTEM: FAPROUASD
CREATED BY: Corpito Sitio Largo
DATE, mm-dd-aaaa February-15-2013
CRC Card
CardReader
SYSTEM: ATM
CREATED BY: Ferreiras
DATE, mm-dd-aaaa: February-15-2013