Object Oriented Programming Lecture 10: UML & CRC
To Do Read Chapter 3 – Think about the questions
Notations CRC cards Unified Modelling Language (UML) – Booch, Grady and Rumbaugh – Class Diagrams – Sequence Diagrams – Object Diagrams
CRC Card Class, Responsibility and Collaboration Cards Ward Cunningham and Kent Beck (Tectronix) 4 by 6 inch index cards (small) Responsibilities / SecretsCollaborations Class Name
Class Diagrams Boxes represent classes – Name of class – Attributes – or data held in the class – Operations – or methods provided by the class Lines represent associations between classes Arrows on the lines represent navigability Numbers on the lines represent multiplicity Open arrow heads show generalisation or viewed the other way inheritance
Class Diagram Name Attributes (Data) Operations (Methods) Name Attributes (Data) Operations (Methods) Name Attributes (Data) Operations (Methods) Name Attributes (Data) Operations (Methods) 1 *
ballWorldball oneball two paint(Graphics)
: BallWorld colour: green ballone : Ball colour: red balltwo : Ball colour: green
: BallWorld colour: green ballone : Ball colour: red balltwo : Ball colour: green exitbutton caption: Exit
Practicals for week 3 Chapter 6 questions 1-14 Exercises 1-4, 6 To be verified are exercises 1-4 as a single program and 6 as a second program