Search code examples
model-view-controllerumlsequence-diagramplantuml

MVC sequence diagram review


My first suggestion was that such questions fit better for CodeReview site. But there's no uml tag on CodeReview. Hope it's fine to post it here.

Here's my first ever sequence diagram. It describes the execution of MVC (CLI) application.

  • View – obviously stands for a view component of MVC approach
  • Application – a controller class
  • Command – an abstract base class and its derivatives
  • model – a bunch of dataclasses
  • Persistence Manager – a class for DB and file-system operations

Are UML notation and logic used correctly? Please, give me some comments on it.

MVC app sequence diagram

Diagram is generated with PlantUML: code.

Light-themed image.


Solution

  • Looks good so far.

    There are some minor notation errors. This is how it should be:

    • create messages are dashed (messages ending in the head of a lifeline)
    • synchroneous messages have a filled trianglular arrow head (messages that preceed a dashed reply message)

    I find it strange that the loop condition has the same name as the operation maincycle. Also the condition needs to be observed by the sender of the first message in the fragment. This is the user.

    The user doesn't have a way to know, that it is ok to send the command. Maybe a feedback is needed, that the view has been created.

    If the user starts the loop, probably she should also be able to end it.

    Of course, a sequence diagram is usually incomplete and only shows one possible sequence. Therefore, it might well be ok as it is.