Download presentation
Presentation is loading. Please wait.
1
Practical Session 2 Class Design
2
UML Basics UML - Unified Modeling Language
3
Class Diagram Name Car Fields Methods
- engineSize : int - maxSpeed : int # getMaxSpeed() : int + drive() Permissions notation: + public, - private, # protected.
4
C has a collection of objects of type D
Relations A B A has an object of type B n C D C has a collection of objects of type D
5
Relations example Car Wheel - engineSize : int - maxSpeed : int
+ drive() # getMaxSpeed() : int Wheel - airPressure: double + roll() 4
6
Inheritance Base Car Derived Ferrari
7
Interface Implementation
Vehicle Implementation Car
8
Abstract Class Name* Car * Fields Non Abstract Methods
- engineSize : int - maxSpeed : int # getMaxSpeed() : int + drive() *
9
Shape Hierarchy example
10
ShapeBase * - canv : Canvas - offset : Point + draw() * + delete() *
+ move(p: Point) Shape draw() delete() move(p: Point) n Polygon Point Circle Triangle Rectangle Square
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.