Download presentation
Presentation is loading. Please wait.
1
UML-diagrams Unified Modelling Language Used for Classes Objects
2
The Class Class-Name Attributes (Fields) Methods Car -noOfGears: int -nextSerialNo: int -speed: float +KM_PER_MILE +park():void +drive(): void +getSpeed(): float +setSpeed(): void -calcPetrolUsage(): float Legend: - private + public # protected static
3
Relations A ”uses” or ”knows” relation – relatively loose. An arrow may indicate direction. A ”has a” relation - aggregation (part of) or composition (only part of and common lifetime) Inheritance – ”is a” Interface – ”a contract”
4
Multiplicity Class 1 Attributes Methods Class 2 Attributes Methods M1 M2 M1 = Number of instances of class 1 that can relate to same instance of class 2 M2 = Number of instances of class 2 that can relate to same instance of class 1 Examples: 0..1Zero or one *Between zero and infinity 1..*From one to infinity 2,7Two or seven
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.