1 / 14

Advanced Object-Oriented Analysis & Design

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. Lesson 8: CRC Cards. 2. Lesson Objectives.

Download Presentation

Advanced Object-Oriented Analysis & Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 SJSU -- CmpE

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

  3. Lesson Objectives • 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 3 SJSU – CmpE --- M.E. Fayad

  4. 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 Existing CRC Cards (1) 4 SJSU – CmpE --- M.E. Fayad

  5. Class Name Superclasses Subclasses Responsibilities Collaborators 1. 2. 3. 1. 2. 3. Existing CRC Cards (2) 5 SJSU – CmpE --- M.E. Fayad

  6. 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 Major Problems with Existing CRC Cards 6 SJSU – CmpE --- M.E. Fayad

  7. Class (Role) Responsibility Collaboration Client Server Proposed CRC Cards (1) 7 SJSU – CmpE --- M.E. Fayad

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

  9. 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 The new CRC Cards address many of the stated problems 6 SJSU – CmpE --- M.E. Fayad

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

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

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

  13. 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 Discussion Questions 13 SJSU – CmpE --- M.E. Fayad

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

More Related