[]{.cart-text} {.btn .cart .open-checkout} []{.btn-text-span .d-none .d-sm-inline-block .d-lg-none .d-hg-inline-block}{.btn .btn-secondary .checkout .open-checkout}

{.home} / UML{.type} / Modeling IT Systems{.type}

Constructing Sequence Diagrams {#constructing-sequence-diagrams .title}

The following checklist shows the necessary steps for constructing a sequence diagram per mutation event from the use cases. Subsequently, we will explain the individual steps further:

Checklist 4.10 Constructing Sequence Diagrams in the Interaction View

  • Identify involved classes---What is affected by mutation events?
  • Determine initial object---Where does the mutation event go first?
  • Propagate events---How is the mutation event forwarded?
  • Specify event parameter---What do objects have to know?
  • Verify the sequence diagram---Is everything correct?

Identify Involved Classes---What is Affected by Mutation Events?

The classes that a mutation event affects have to be identified. This occurs on the basis of statechart diagrams (see The Behavioral View). The questions are:

  • Which classes are already affected by a certain mutation event? To answer this question you will have to look up which statechart diagrams contain the mutation event. If the mutation event is present in a statechart diagram of a class, this class is affected by the mutation event, meaning that the mutation event has to be sent to this class.
  • Which other classes are affected by the mutation diagram? It could be that there are classes that are affected by the mutation event, but which are not yet present in statechart diagrams.

The first question can easily be answered. Most CASE tools can generate, for instance, a list of classes already affected. In order to find further affected classes, look at the class diagram and think whether anything has to happen with the objects of each class when the mutation event occurs. At the least, you should take another look at those classes that are located close to some of the classes already affected on the class diagram. Of course, if additional classes are found, their statechart diagrams have to be updated by inserting the mutation event. In our case study, the mutation event «M» record piece of luggage affects the classes coupon and piece of luggage, as shown in Figure 4.74:

Figure 4.74 Affected classes in the sequence diagram

Determine Initial Object---Where does the Mutation Event go First?

A mutation starts with the initial object. The initial object can be a class (in its function as a set) or a particular object of a class. If a certain object is directly addressed, for example, a certain flight object or a certain ticket object, this object has to be known before the mutation event is sent. If a class is addressed, parameters can be attached to the mutation event as selection parameters, so that a particular object can be chosen. All further needed classes have to be accessible from the initial object through connections. The concrete questions are:

  • Which is the first object the event should go to??
  • Which object do I know already?
  • Where do I start collecting information?

In our case study, during the mutation event «M» record piece of luggage, the coupon object is already known, since the entire check-in occurs for on a particular coupon. The new piece of luggage object that is to be recorded does not yet exist. Therefore, the initial object is the coupon object.

Propagate Events---How is the Mutation Event Forwarded?

Starting from the initial object, a sequence is determined, in which the affected objects receive the mutation event. The question is:

  • In which order do I reach all affected objects in the class diagram??

Mutation events are forwarded along the relationships in the class diagram to all classes that are affected by the mutation event. In the class diagram of the case study an association exists from the coupon to a piece of luggage, along which a mutation event can be sent, as illustrated in Figure 4.75:

Figure 4.75 Events in a sequence diagram

Specify Event Parameter---What do Objects have to Know?

The information required to process the mutation event is forwarded as parameters of the event. The question is:

  • Which information do the objects need in order to process the mutation??

In order to generate a new piece of luggage object in our case study, we need its weight. Therefore, weight will be forwarded as an event parameter, as shown in Figure 4.76:

Figure 4.76 Event parameter in a sequence diagram

Verify the Sequence Diagram---Is Everything Correct?

The completed sequence diagram can be verified with the following checklist:

Checklist 4.11 Verifying Sequence Diagram in the Interaction View

  • Are all classes affected by the mutation event listed in the sequence diagram?
  • Is the mutation event forwarded along an association in the class diagram?

If the answer to both these questions is yes, the largest sources of mistakes have been eliminated.

Modeling for System Integration []{.fa .fa-arrow-right}{.btn .btn-primary rel=“next”}

Return

[]{.fa .fa-arrow-left} Constructing Communication Diagrams{.btn .btn-default rel=“prev”}

Computer Science Distilled{.btn .btn-landing-ref .btn-hg .btn-block .btn-secondary style=“font-size: 16px; position: relative”}

Do you remember anything at all from your computer science class? Quicksort, Graph traversal, Big’O and other stuff? Revise your memories with our new book on Computer Science.

Psst! Did I mention that we’re offering sexy discounts right now?

SourceMaking{width=“250” height=“312” srcset=“/images/content-public/logos/logo-2x.png?id=fee3b4b0a14ba60dc0fe368695d78be9 2x”}{.menu-brand}

Log in Contact us{.userecho-public rel=“nofollow”}

SourceMaking{srcset=“/images/content-public/logos/logo-min-xs-2x.png?id=34fc05750336c33b7815e231a0f227df 2x”}{.navigation-brand}

Shop Now!{.btn .btn-md .btn-primary .btn-featured}

© 2007-2023 SourceMaking.com[ / ]{.d-none .d-md-inline}
All rights reserved.

Terms / Privacy policy

[]{.cart-text} {.btn .cart .open-checkout} []{.btn-text-span .d-none .d-sm-inline-block .d-lg-none .d-hg-inline-block}{.btn .btn-secondary .checkout .open-checkout}

{.home} / UML{.type} / Modeling IT Systems{.type}

Constructing Sequence Diagrams {#constructing-sequence-diagrams-1 .title}

The following checklist shows the necessary steps for constructing a sequence diagram per mutation event from the use cases. Subsequently, we will explain the individual steps further:

Checklist 4.10 Constructing Sequence Diagrams in the Interaction View

  • Identify involved classes---What is affected by mutation events?
  • Determine initial object---Where does the mutation event go first?
  • Propagate events---How is the mutation event forwarded?
  • Specify event parameter---What do objects have to know?
  • Verify the sequence diagram---Is everything correct?

Identify Involved Classes---What is Affected by Mutation Events?

The classes that a mutation event affects have to be identified. This occurs on the basis of statechart diagrams (see The Behavioral View). The questions are:

  • Which classes are already affected by a certain mutation event? To answer this question you will have to look up which statechart diagrams contain the mutation event. If the mutation event is present in a statechart diagram of a class, this class is affected by the mutation event, meaning that the mutation event has to be sent to this class.
  • Which other classes are affected by the mutation diagram? It could be that there are classes that are affected by the mutation event, but which are not yet present in statechart diagrams.

The first question can easily be answered. Most CASE tools can generate, for instance, a list of classes already affected. In order to find further affected classes, look at the class diagram and think whether anything has to happen with the objects of each class when the mutation event occurs. At the least, you should take another look at those classes that are located close to some of the classes already affected on the class diagram. Of course, if additional classes are found, their statechart diagrams have to be updated by inserting the mutation event. In our case study, the mutation event «M» record piece of luggage affects the classes coupon and piece of luggage, as shown in Figure 4.74:

Figure 4.74 Affected classes in the sequence diagram

Determine Initial Object---Where does the Mutation Event go First?

A mutation starts with the initial object. The initial object can be a class (in its function as a set) or a particular object of a class. If a certain object is directly addressed, for example, a certain flight object or a certain ticket object, this object has to be known before the mutation event is sent. If a class is addressed, parameters can be attached to the mutation event as selection parameters, so that a particular object can be chosen. All further needed classes have to be accessible from the initial object through connections. The concrete questions are:

  • Which is the first object the event should go to??
  • Which object do I know already?
  • Where do I start collecting information?

In our case study, during the mutation event «M» record piece of luggage, the coupon object is already known, since the entire check-in occurs for on a particular coupon. The new piece of luggage object that is to be recorded does not yet exist. Therefore, the initial object is the coupon object.

Propagate Events---How is the Mutation Event Forwarded?

Starting from the initial object, a sequence is determined, in which the affected objects receive the mutation event. The question is:

  • In which order do I reach all affected objects in the class diagram??

Mutation events are forwarded along the relationships in the class diagram to all classes that are affected by the mutation event. In the class diagram of the case study an association exists from the coupon to a piece of luggage, along which a mutation event can be sent, as illustrated in Figure 4.75:

Figure 4.75 Events in a sequence diagram

Specify Event Parameter---What do Objects have to Know?

The information required to process the mutation event is forwarded as parameters of the event. The question is:

  • Which information do the objects need in order to process the mutation??

In order to generate a new piece of luggage object in our case study, we need its weight. Therefore, weight will be forwarded as an event parameter, as shown in Figure 4.76:

Figure 4.76 Event parameter in a sequence diagram

Verify the Sequence Diagram---Is Everything Correct?

The completed sequence diagram can be verified with the following checklist:

Checklist 4.11 Verifying Sequence Diagram in the Interaction View

  • Are all classes affected by the mutation event listed in the sequence diagram?
  • Is the mutation event forwarded along an association in the class diagram?

If the answer to both these questions is yes, the largest sources of mistakes have been eliminated.

Modeling for System Integration []{.fa .fa-arrow-right}{.btn .btn-primary rel=“next”}

Return

[]{.fa .fa-arrow-left} Constructing Communication Diagrams{.btn .btn-default rel=“prev”}

Computer Science Distilled{.btn .btn-landing-ref .btn-hg .btn-block .btn-secondary style=“font-size: 16px; position: relative”}

Do you remember anything at all from your computer science class? Quicksort, Graph traversal, Big’O and other stuff? Revise your memories with our new book on Computer Science.

Psst! Did I mention that we’re offering sexy discounts right now?

SourceMaking{width=“250” height=“312” srcset=“/images/content-public/logos/logo-2x.png?id=fee3b4b0a14ba60dc0fe368695d78be9 2x”}{.menu-brand}

Log in Contact us{.userecho-public rel=“nofollow”}

SourceMaking{srcset=“/images/content-public/logos/logo-min-xs-2x.png?id=34fc05750336c33b7815e231a0f227df 2x”}{.navigation-brand}

Shop Now!{.btn .btn-md .btn-primary .btn-featured}

© 2007-2023 SourceMaking.com[ / ]{.d-none .d-md-inline}
All rights reserved.

Terms / Privacy policy