4/9/2024 0 Comments Sequence diagrams if then elseCommon Operators for Interaction FramesĪlternative multiple fragments only the one whose condition is true will execute ( Figure 4.4). These notations have been dropped from sequence diagrams in UML 2, they are still legal on communication diagrams. Guards are a conditional expression placed in square brackets and indicate that the message is sent only if the guard is true. You can add some text in square brackets to indicate the basis of the iteration. An iteration marker is a * added to the message name. Figure 4.5 shows some of these unofficial tweaks.įigure 4.5. As a result, you may see diagrams prepared before UML 2 and that use a different approach Īlso, some people don’t like the frames and prefer some of the older conventions. Only the fragment whose guard is true will execute. For conditional logic, you can use an alt operator and put a condition on each fragment. (Table 4.1 lists common operators for interaction frames.) To show a loop, you use the loop operand with a single fragment and put the basis of the iteration in the guard. Each frame hasĪn operator and each fragment may have a guard. In general, frames consist of some region of a sequence diagram that is divided into one or more fragments. Figure 4.4 shows a simple algorithm based on the following pseudocode: Both loops and conditionals use interaction frames, which are ways of marking off a piece of a sequence diagram. Treat sequence diagrams as a visualization of how objects interact rather than If you want to show control structures like this, you are better off with anĪctivity diagram or indeed with code itself. This isn’t what sequence diagrams are good at. UML Distilled: A Brief Guide to the Standard Object Modeling Language, 3rd EditionĪ common issue with sequence diagrams is how to show looping and conditional behavior.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |