Search code examples
umlsoftware-designclass-diagramsequence-diagram

From sequence Diagram to Class diagram


I'm trying to understand sequence diagrams and class diagrams. I just don't clearly understand how to find one if you have the other.

for example in this sequence diagram

enter image description here

to convert it to class diagram I would create three classes : Student, Seminar & Course.

my question is for example the enrollStudent() function should I put it as member function of Student class or Seminar class?


Solution

  • Operation or reception should be on a receiving end, that is in your example enrollStudent should be member of Seminar.

    As for creating class diagram from sequence or vice versa - it doesn't work this way. These are different views of the same system and are created more or less in parallel. While dependency between message and class is simple, you see neither logic of sequence on class not the opposite. Otherwise it wouldn't make sense to have two diagrams.