As stated the aim of a sequence representation is to define event sequences, which would have a wanted result. The emphasis is a lot more on the order in which messages take place than on the message per se. Nevertheless, the majority of series representations will connect what messages are sent and the order in which they often tend to happen.
When attracting a sequence representation, keep in mind that lifeline symbols components are placed throughout the top of the representation. Lifelines are representative of roles or item circumstances that take part in the sequence being modeled. From a aesthetic point of view, lifelines are shown as a box with a dashed line descending from the center of the bottom side. The lifeline's name is placed inside package. Additionally, the lifeline name is highlighted. What this implies is that the lifeline represents a particular instance of a course in a sequence layout.
For readability, the first message of a series layout always begins at the top and lies on the left side of the layout. Subsequent messages are then contributed to the layout a little reduced after that the previous message. To show an item or lifeline sending out a message to another object, you draw the line to the getting object with a solid arrowhead (if a synchronous phone call operation) or with a stick arrowhead (if an asynchronous signal). The message/method name is put over the arrowed line. The message that is being sent out to the receiving things represents an operation/method that the obtaining item's class implements.
When modeling item interactions, there will be times when a condition must be satisfied for a message to be sent to an item. Guards are conditions that require to be made use of throughout UML representations to manage circulation. Bear in mind that a guard could only be designated to a solitary message. To draw a guard on a sequence layout, you positioned the guard element over the message line being protected and before the message name, as revealed below.
This sort of elements are used to suggest a mutually unique choice that exists in between a lot more that a person message sequence. Alternatives enable the modeling of the "if then else" reasoning (e.g., if you were to get 3 things, then you get 20% off your purchase; whereas you get 10% off your acquisition). As you can see below, will observe that an alternative combination piece aspect is attracted making use of a frame. The word "alt" is placed inside the framework's name box.
The alternative mix component or piece is used to model a sequence that will certainly happen offered it is given a particular problem. If not, the series does not occur. An choice is typically made use of to design a simplified "if after that" statement, for instance, if there are less than 5 donuts present on the counter, then make 2 lots extra. The image listed below usages an option mix piece given that a lot of messages need to be sent out if the student's unpaid balance is equal to zero. According to the representation, if a student's past due balance equals zero, after that the addStudent, getCostOfClass, and also chargeForClass messages are sent out. If the student's overdue equilibrium does not equal no, then the series avoids sending out any one of the messages in the option mix fragment. We consist of a guard for the choice; nevertheless, the guard is not a required component.
Loopholes are instead fundamental and also very easy to understand. This is something that is utilized when you need to model a repetitive series. In UML 2, modeling a duplicating sequence has been improved with the enhancement of the loop mix piece. The loop combination piece is really comparable in look to the alternative mix fragment. You attract a frame, as well as in the structure's namebox the message " loophole" is put. Inside the structure's content location the loop's guard is positioned towards the top left edge, on top of a lifeline.