Presentation is loading. Please wait.

Presentation is loading. Please wait.

L8-S1 CRC Cards 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.

Similar presentations


Presentation on theme: "L8-S1 CRC Cards 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College."— Presentation transcript:

1 L8-S1 CRC Cards 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad

2 L8-S2 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad 2 Lesson 8: CRC Cards

3 L8-S3 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad Lesson Objectives 3 Understand the existing CRC Cards Understand the problems with existing CRC Cards Understand and use my CRC Cards Learn how to create a CRC Cards

4 L8-S4 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad CRC stands for Class, Responsibilities, Collaborations Basic Ideas –Create a card for each class –Assign responsibilities and attributes to each card –Identify collaborations between cards –Simulate design scenarios between sets of cards 4 Existing CRC Cards (1)

5 L8-S5 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad 5 Existing CRC Cards (2) Class Name Superclasses Subclasses ResponsibilitiesCollaborators 1. 2. 3. 1. 2. 3.

6 L8-S6 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad  Low Cohesion and High Coupling  Macho Class  Duplicate Functionality  No Clear Role is Defined  Difficulty in Defining Responsibilities  Hard to Map CRC Cards to Class Diagram 6 Major Problems with Existing CRC Cards

7 L8-S7 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad 7 Proposed CRC Cards (1) Class (Role) ResponsibilityCollaboration ClientServer

8 L8-S8 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad 9 CRC Cards (2) Class (Role) ResponsibilityCollaboration ClientServer Specify one, unique responsibility within the context that is based on the assigned role CollaboratorsServices or interfaces that are provided by the named class – no duplicates among classes 1. Define role 2. Provide one, unique responsibility 3. Identify collaborators

9 L8-S9 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad  Reduces chances of low cohesion/high coupling by limiting responsibilities  Eliminates macho classes as the intelligence is distributed evenly  Including services addresses two problems:  verifies the validity of the class responsibility  ensures that overlapping functionality is avoided  Simplifies responsibility definition when a clear role is specified  Class Diagram constructs itself 6 The new CRC Cards address many of the stated problems

10 L8-S10 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad Determining a role for each class is useful when defining the class responsibility Example: User- two distinct roles Analyst (modifier) Engineer (viewer) CRC Cards (3)

11 L8-S11 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad CRC Cards (4)

12 L8-S12 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad 11 The collaborations identified in the CRC cards can be used to connect the classes in the class diagram

13 L8-S13 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad What are the good, bad, and ugly about CRC cards? Propose a process of how to use the CRC cards T/F –CRC stands for Common Responsible Class –CRC cards contains many responsibilities per class. –In the CRC cards, collaborators don’t have any relationship with the CRC’s named class. Define: –CRC, responsibilities, and collaborators 13 Discussion Questions

14 L8-S14 CRC Cards 2003 SJSU – CmpE --- M.E. Fayad Discuss how to identify objects, classes, attributes, operations, and relationships 14 Questions for the Next Lecture


Download ppt "L8-S1 CRC Cards 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College."

Similar presentations


Ads by Google