AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Of the diagram, so I prefer pseudomessages. In particular, I find the interaction frames very heavy, obscuring the main point Data tadpoles have been around in many methods to indicate the movement of data, and many people still like to use them with the UML.Īll in all, although various schemes can add notation for conditional logic to sequence diagrams, I don’t find that they workĪny better than code or at least pseudocode. The UML standard has no graphic device to show passing data instead, it’s shown by parameters in the message name and returnĪrrows. Shown on Figure 4.5 is to drop the activation for those simple calls. Show that with an alternative marker between the activations.Īlthough I find activations very helpful, they don’t add much in the case of the dispatch method, whereby you send a message and nothing else happens within the receiver’s activation. Some also like to gray shade the pseudomessage’s activation bar. In Figure 4.5, I’ve shown this without a message arrow some people include a message arrow, but leaving it out helps reinforce that this To get around this last problem, an unofficial convention that’s become popular is to use a pseudomessage, with the loop condition or the guard on a variation of the self-call notation. Both notations work only with a single message send and don’t work well when several messages coming out of a single activationĪre within the same loop or conditional block. Mutually exclusive, such as the two on Figure 4.5. The guards can’t indicate that a set of guards are Sequence diagram used to surround an entire sequence diagram, if you wish.Īlthough iteration markers and guards can help, they do have weaknesses. You can define parameters and a return value. The frame is drawn to cover the lifelines involved in the Reference refers to an interaction defined on another diagram. Negative the fragment shows an invalid interaction. Loop the fragment may execute multiple times, and the guard indicates the basis of iteration ( Figure 4.4).Ĭritical region the fragment can have only one thread executing it at once. Parallel each fragment is run in parallel. Equivalent to an alt with only one trace ( Figure 4.4). Optional the fragment executes only if the supplied condition is true. Common 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
Read More
Leave a Reply. |