100 likes | 145 Views
Learn about UML notations, CRC cards, and class diagrams for effective OOP design. Dive into attributes, operations, and collaboration in this detailed lecture. Master the fundamentals through practical examples and exercises.
E N D
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) Class Name Responsibilities / Secrets Collaborations
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) 1 * Name Attributes (Data) Operations (Methods) Name Attributes (Data) Operations (Methods)
ballWorld ball one ball two paint(Graphics) paint(Graphics) 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