Ooad presentatin crc cards

18
CRC Card

Transcript of Ooad presentatin crc cards

Page 1: Ooad presentatin crc cards

CRC Card

Page 2: Ooad presentatin crc cards

A brainstorming tool used in the design of object-oriented software.

A collection of standard index cards that have been divided into three sections 1. A class represents a collection of similar objects.2. A responsibility is something that a class knows or does. 3. A collaborator is another class that a class interacts with to fulfill its responsibilities.

The cards are arranged to show the flow of messages among instances of each class.

CRC stands for Class, Responsibilities, Collaborations

What is CRC card ?

Page 3: Ooad presentatin crc cards

Originally proposed by Ward Cunningham and Kent Beck as a teaching tool, but are also popular among expert designers and recommended by extreme programming supporters.

Page 4: Ooad presentatin crc cards

Martin Fowler has described CRC cards as a viable alternative to UML sequence diagram to design the dynamics of object interaction and collaboration.

Page 5: Ooad presentatin crc cards

Create a card for each class

Assign responsibilities and attributes to each card

Identify collaborations between cards

Simulate design scenarios between sets of cards

BASIC IDEAS

Page 6: Ooad presentatin crc cards

Portable: cards can be used anywhere, even away from the computer or office Anthropomorphic: no computer program can capture the essence of the interactions

forced by passing the cards Level of involvement felt by each team member increases Useful throughout the life cycle Provides a basis for more formal analysis and design methodologies Serves as input to a formal method (i.e., a starting point) Ease the transition from process orientation to object orientation - most formal

methods are overwhelming Gives a general bound on the size of a class - a card

ADVANTAGES

Page 7: Ooad presentatin crc cards
Page 8: Ooad presentatin crc cards
Page 9: Ooad presentatin crc cards

Define class role Provide one unique responsibility Identify collaborators (Clients and Services)

Prepare a CRC card for each identified class

Page 10: Ooad presentatin crc cards

EXAMPLE 1

Page 11: Ooad presentatin crc cards

Example…Student CRC card

Page 12: Ooad presentatin crc cards

EXAMPLE 2

Page 13: Ooad presentatin crc cards

EXAMPLE 3

Page 14: Ooad presentatin crc cards

EXAMPLE 4

Page 15: Ooad presentatin crc cards

EXAMPLE 5

Page 16: Ooad presentatin crc cards

EXAMPLE 6

Page 17: Ooad presentatin crc cards

1) Macho Class2) Duplicate Functionality3) Difficulty in Defining Responsibilities 4) No Clear Role is Defined 5) Hard to Map CRC Cards to Class Diagram

Major Problems with Existing CRC Cards

Page 18: Ooad presentatin crc cards