Docsity

CRC-Software Engineering-Lecture Slides, Slides of Software Engineering

Partial preview of the text

Download CRC-Software Engineering-Lecture Slides and more Slides Software Engineering in PDF only on Docsity!

CRC CARDS(CLASS-RESPONSIBILITY-COLLABORATOR)

CRC Cards

CRC Cards 2^ ^ Introduced in^1989

by^ Kent^ Beck^ and WardCunningham  A CRC card is an index card in a group settingused to represent:  a class of objects  their behavior  their interactions  To document the essential properties of a class.

CRC definitions

CRC Cards 4^ ^ Class: represents a collection of similar objects.^ ^ Responsibility:^ knowledge

class^ maintains^ or service class provides  Collaborator:^ a^ class

whose^ knowledge^

or services are needed to fulfill a responsibility

Responsibility

CRC Cards 5^ ^ A Responsibility is anything that the class knows ordoes.^ ^ These responsibilities are things that the class hasknowledge about itself, or things the class can dowith the knowledge it has.

Find Collaborations

Top-level designFind ClassesFind ResponsibilitiesAnalyze CollaborationsAnalyze Responsibilities

CRC Cards 7

Finding Classes

CRC Cards 8^ ^ Noun Extraction^ ^ Noun extraction identifies all of the Nouns in a problemstatement and/or use-case scenario.^ ^ The nouns extracted make excellent candidate classes^ ^ Look for items that interact with the system,^ ^ Things that are part of the system

Finding Collaborators

CRC Cards 10^ ^ To perform a task, a class needs information that itdoesn't have^ ^ A class needs to modify information that it doesn’thave

BookLibrarianBorrowerCheck outCheck book outBookAllowed to check outCheck inCheck book inBorrowerKnow list of booksKnow due dateSearch for bookchecked outKnow borrower

Book

Collaborators

CRC Cards 11^ ^ An object may call upon the responsibilities of other objects during theexecution of its responsibilities: these other objects are “collaborators”^ ^ Example:^ ^ In a library system, there are three important classes:Book, Librarian, and Borrower^ ^ The Librarian class needs to collaborate with Book andBorrower in order to check books in and out

Example… student CRC card

CRC Cards 13

Advantages

CRC Cards 14^ ^ 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 bypassing the cards  level of involvement felt by each team memberincreases  useful throughout the life cycle

References

CRC Cards 16^ ^ Wolfgang Pelz 2000-04^ ^ Introduction to CRC Cards, David M. Rubin