|
|
czi |
|
|
\ No newline at end of file |
|
|
**Sources:** http://www.omg.org/spec/UML/2.5 (Starting at PDF page 192)
|
|
|
|
|
|
# Usage Scenarios
|
|
|
The **class diagram** is used to describe central classes within a software system (or at least a part of it) and their relationship among each other. This kind of diagram can be greatly used to get a detailed overview of employed objects and their relationships within the overall system.
|
|
|
For example, you can use it in the early design phase of a new software system to model the essential classes, attributes, and their relations.
|
|
|
|
|
|
# Obligations for the lectures and the final exam in "Softwaretechnik" (Tips for Modeling)
|
|
|
When creating a **class diagram**, remember that it must contain all necessary information (attributes, methods, visibility, relationships). Otherwise a component diagram is useless and can be thrown away. Especially for relationships (associations) it is important to specify the cardinality (e.g., 1, 0..*, 1..*) and the name of it (e.g., "provides", "contains", "has")
|
|
|
An example class diagram is shown in [Example ClassDiagram](#an-example-class-diagram-for-the-given-scenario).
|
|
|
|
|
|
# What is a Class?
|
|
|
Consider a class as a blueprint for creating an object during runtime of an application.
|
|
|
|
|
|
# Example Scenario
|
|
|
Assume that your customer wants you to develop a web application called "StudentData" which is similar to the StudiDB. This application must be accessible by students, lecturers, and administrators. All of these users must be able to register and to login. For this purpose, an external authentication service is used. Students can join lectures and view their exams taken so far. Lecturers can assign grades to students and print reports with statistics about their lectures. Administrators can add users and lectures.
|
|
|
|
|
|
## An Example Component Diagram for the given Scenario
|
|
|
The following figure shows an example UML component diagram which reflects the requirements mentioned in [Example Scenario](#example-scenario):
|
|
|
|
|
|

|
|
|
|
|
|
### Explanation
|
|
|
We model several classes in order to represent the central objects within our web application *StudentData*. |