Search code examples
umlsequence-diagram

How to set duplicate value validation in sequence diagram?


I'm using the boundary-control-entity model for my sequence diagram, but in the alt fragment I'm confused about the interactions between the control and the entity in case the entity I'm adding contains duplicated fields. shoudl I put select() before entering the alt fragment to show that the control is checking whether the informations are duplicated or no ?

My diagram: 5.Select() is the message I'm asking about enter image description here


Solution

  • It's correct that way. The test condition is executed first. The alt fragment evaluates the existing conditions via the guards. These guards can contain anything and relate to something that happened any time (and not only directly) before.

    Personal note: graphical programming is not really the silver bullet as it was praised in the 90s. SDs are fine to give an overview of collaborating objects. But when you try to go into details (like when using fragments) you soon recognize its shortcomings.