90 likes | 221 Views
Fundamentals of Object-Oriented Analysis and Design. Lecture Three: CRC Session. Objectives. Experience a live CRC card session Learn to discover classes and collaborators Learn to validate class and collaborator discovery by working through scenarios. Initial Class Discovery.
E N D
Fundamentals of Object-Oriented Analysis and Design Lecture Three: CRC Session FOOAD: Lecture Three
Objectives • Experience a live CRC card session • Learn to discover classes and collaborators • Learn to validate class and collaborator discovery by working through scenarios FOOAD: Lecture Three
Initial Class Discovery • All ideas are potential good ideas • Think fast first, ponder later • Listen to every voice • Have fun FOOAD: Lecture Three
Class Discovery Exercise (1) • Work in teams of three-five people • Create a CRC card for each class with name and description • Stay in the project scope • Distinguish between attributes and classes • Look out for phantoms and ghosts, surrogates and aliases • Identify the essential classes in the problem statement in less than 20 minutes • DON'T GET SIDTRACKED BY DETAILS! FOOAD: Lecture Three
Class Discovery Exercise (2) • Change teams • Discover the essential responsibilities for each class in less than 20 minutes • Only record responsibilities at this point • What does the class have to be able to do? • What does the class need to know? • Concentrate on WHAT, not HOW • DON'T GET SIDTRACKED BY DETAILS! FOOAD: Lecture Three
Class Discovery Exercise (3) • Change teams • Discover the collaborators for each responsibility of each class in less than 20 minutes • If a collaborator class is needed but doesn't exist, create one FOOAD: Lecture Three
Questions to Ask of a "Good Class" • A good class will: • Have a clear unambiguous name recognized in the business domain • Have a singular noun for its name • Have responsibilities • Remember (have knowledge) • Be needed by other classes (collaborates) • Actively participates in the system FOOAD: Lecture Three
Class Discovery Exercise (4) • Change teams • Each member of the team gets an equal share of the CRC cards developed so far • Work through each use case scenario at least twice • When an unmet responsibility is discovered, either assign it to an existing class, or create a new class • When a missing class is discovered, stop and make a CRC card for it • Take a break every 20 minutes • Don't stop until you can go through each scenario without discovering an unmet responsibility FOOAD: Lecture Three
As an action occurs: • The person(s) with the CRC card(s) of the class(es) responsible for the system response will pick up the card • Declare her/himself to be an object of the class • Declare he/she will fulfill the responsibility, and call on any collaborating class(es) • The person(s) with the CRC cards of the collaborating classes will pick up the card…etc. FOOAD: Lecture Three