Ooad presentatin crc cards

Post on 15-Jan-2017

396 views 0 download

Transcript of Ooad presentatin crc cards

CRC Card

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 ?

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.

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

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

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

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

Prepare a CRC card for each identified class

EXAMPLE 1

Example…Student CRC card

EXAMPLE 2

EXAMPLE 3

EXAMPLE 4

EXAMPLE 5

EXAMPLE 6

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