Kontakt
stefan.bente[at]th-koeln.de
+49 2261 8196 6367
Discord Server
Prof. Bente Personal Zoom
Adresse
Steinmüllerallee 4
51643 Gummersbach
Gebäude LC4
Raum 1708 (Wegbeschreibung)
Sprechstunde nach Vereinbarung
Terminanfrage: calendly.com Wenn Sie dieses Tool nicht nutzen wollen, schicken Sie eine Mail und ich weise Ihnen einen Termin zu.

Übung »Zustandsdiagramm für ein Entity«

In dieser Übung beschäftigen wir uns mit Zustandsmodellierung - Aufstellen eines Zustandsdiagramms auf der Basis eines erklärenden Textes für ein gegebenes Entity oder Aggregate.

Dauer
Ca. 90 min
Video(s) hierzu

Worum geht es?

Schauen wir noch einmal auf unser Campus-Management-System (CAMS). Schriftliche Prüfungen könnte man etwa wie folgt abbilden:

Logisches Datenmodell _Exams_ im CAMS

Sie sollen jetzt für das Entity1 Exam ein Zustandsdiagramm aufstellen. Die Beschreibung der fachlichen Abläufe ist wie folgt gegeben (auf Englisch):

An exam is created with a title. From the moment of creation, the exam is open for registration. In that period, students can register for taking the exam. They can also cancel their participation without any reasons. Approximately one week before the exam, a supervisor manually closes the registration period (there is no automatic mechanism). From now on until the exam start, students can neither register anymore, nor cancel their participation.

At the time of the exam, again a supervisor manually starts the exam. The students can now upload a solution, provided that they are indeed registered for the exam. It is possible to upload multiple solutions; only the latest is stored. At the end of the exam (usually 2h), a supervisor (again manually) closes the exam. From now on, no more solutions can be uploaded by the students.

The small team of supervisors starts the correction. They take an uploaded student solution, and upload a correction (as a seperate file). It is possible to upload multiple corrections; only the latest one is stored.

As soon as all student solutions have been corrected, one of the supervisors performs one last check on all corrections. If something is wrong, he marks it as “disputed”. For the those corrections, the supervising team uploads new versions. The supervisor again looks over all corrections etc. This loop is repeated until the correction phase is finished, i.e. there all corrections have the “disputed” flag = FALSE.

When that state has been reached, a supervisor publishes the exam results. No more corrections can be uploaded, and the students can access their solutions including the attached corrections. After some time period, a supervisor archives the exam. From then on, no more access to solutions and corrections is possible.

Ihre Aufgabe

Stellen Sie ein Statusdiagramm für das Entity Exam auf, das den obigen Text wiedergibt. Hinweis: Sie sollten nicht mehr als sechs Zustände benötigen (ohne Initial und Final State).

Lösung

Ein Exam durchläuft die folgenden Zustände:

  • REGISTRATION_OPEN
  • REGISTRATION_CLOSED
  • STARTED
  • CLOSED
  • PUBLISHED
  • ARCHIVED

Eine Beispiellösung kann dann wie folgt aussehen:

Zustandsdiagramm


  1. Eigentlich handelt es sich um ein Aggregate, das sind mehrere eng zusammenhängende Entities und Value Objects. In unserem Fall würden Exam, Exam und Exam allesamt dazugehören. Mit dem Begriff des Aggregates werden wir uns ST2 noch eingehend beschäftigen, da er die Basis für REST-APIs ist.