UML Diagram
Reading a UML Class Diagram
Where:
- scope is indicated as + public, - private, (# protected, ~ package - these are not focused on in CS149).
- The arg list is a list of parameter types (e.g., int, double, String) it can also include type after a :
- Class (i.e. static) methods and fields are indicated by underlining
- Constant (i.e. final) fields are indicated via naming convention: constants should be in ALL_CAPS
Lines between classes indicate relationships as follows:
and can have numbers indicating instances of or 'multiplicity' as follows:
0 | No instances (rare) |
0..1 | No instances, or one instance |
1 | Exactly one instance |
1..1 | Exactly one instance |
0..* | Zero or more instances |
* | Zero or more instances |
1..* | One or more instances |
For example: