Presentation is loading. Please wait.

Presentation is loading. Please wait.

Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”

Similar presentations


Presentation on theme: "Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”"— Presentation transcript:

1 Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”

2  Dynamic view – sequence diagrams ◦ role and types of sequence diagrams ◦ basic concepts ◦ advanced concepts ◦ examples 2

3  Sequence diagram is a kind of interaction diagram, describing interactions among system classifiers in the form of sequence of messages interchanged between them during a certain period of time.  Sequence diagrams are closely related to use case scenarios as they document their functionality.  Interaction is shown on the sequence diagram in two dimensions: o Horizontal - static dimension where the system classifiers taking part in the interaction are placed o Vertical – dynamic dimension, with the time line showing chronically arranged messages 3

4 Depending on the degree of abstraction three types of sequence diagrams can be specified:  Conceptual sequence diagram – using only basic concepts, for quick and general overview of the system interactions  Generic sequence diagram – is the basis for software specification and uses all available concepts; this type of diagram includes the main and all alternative scenarios of a use case and it can be used for automatic generation of program code  Instance sequence diagram – a diagram describing one particular scenario of a use case; there may be several instance diagrams for one generic diagram 4

5  Classifier – abstract category of system modeling in UML (e.g. actor, object, interface, component, package, etc.)  Message – describes a control flow in the system; it determines the sequence and place of execution of operations; messages are arranged according to the sequence of their appearance – the later they occur the lower they appear on the diagram  Each classifier has a lifeline that represents its life time; the “X” mark at the end of the lifeline indicates the point at which the object ceases to exist in the system  The execution specification shows time period during which the classifier performs an operation (processing, calculating, communicating with other classifiers or executing complex algorithms); the execution specification is initiated with an activation and ended with deactivation. 5

6 6 Classifier (actor, object, interface, package) Message Lifeline

7 7 Activation Execution specification Deactivation

8  Types of messages  Creating and destroying objects  Guard conditions  Combined fragments with interaction operators  Interaction occurrences 8

9 Message types:  synchronous message – passes control from the sender classifier to the receiver classifier  asynchronous message – does not pass control, does not wait for an answer from the receiver, may continue processing  return message – indicates control return to the sender classifier after synchronous message and may also initiate a certain operation  self message – message sent by the classifier to itself resulting in calling its own operation; self message is a certain kind of iteration, which creates a nested execution specification 9

10 10 Asynchronous message Synchronous message

11 11 Self message Return message

12 Other message types:  lost message – message sent from a known sender to an unknown receiver (temporary message)  found message – message whose sender is unknown (may be an external signal, stimulus)  balking message – message which will not be handled by the receiver classifier if it cannot be handled immediately  timeout message – similar to balking message although sender classifier is willing to wait for handling the operation for a specified period of time 12

13 Creating and destroying objects:  „create” stereotype message – results in creation of an object, which is situated below the primary existing classifiers, corresponding with the time of its creation  „destroy” stereotype message – results in destruction of an object 13

14 14 > message

15  Guard condition – a criterion connected with the message, on fulfillment of which depends the execution of a specified operation.  If a condition referring to a certain message is not met the operation indicated by the message is not executed.  Conditions are placed in square brackets before the message name  Realization of a message can be conditioned by more than one condition 15

16 16 Guarding condition

17 alt – alternative opt – option break – interruption loop – iteration neg – improper functionality par - concurrency critical – critical region assert – formula consider – significance ignore – insignificance stricte – strict order seq – weak order 17  Combined fragment – is a logically consistent area of interaction, a part of a sequence diagram characterized by specific properties defined by the interaction operator  Interaction operator – specifies the functionality realized by the combined fragment  Interaction operators:

18 18 Selected, most common operators:  alternative (alt) – means a possibility to choose only one of all presented interaction operands within the combined fragment, depending on the condition assigned to the operand  option (opt ) – means that the operand within the combined fragment will occur or will be omitted, depending on the condition  interruption (break) – is a abbreviated form of alt with only one defined operand and when the combined fragment is executed other interactions are ignored  iteration (loop) – means repeating the operand a specified number of times

19 19

20 20

21 21

22 22

23 23  Interaction occurrence – is a reference to a linked interaction diagram, placed within the base diagram  Interaction occurrences are especially useful in case of extensive sequence diagrams, which refer to other diagrams defined earlier  Interaction occurrence can be invoked either by a message or by time factor

24 24 Interaction occurrence

25 25  Analysis of a selected use case and its scenarios  Identification of classifiers taking part in the interaction  Development of conceptual sequence diagram including (identified classifiers, messages and execution specifications)  Development of a generic sequence diagram on the basis of the conceptual diagram by adding advanced concepts like: different message types, conditions, combined fragments, interaction occurrences  Optional development of instance sequence diagrams for a selected generic diagram

26 26  UML Sequence Diagrams: Guidelines https://msdn.microsoft.com/en- us/library/dd409389.aspx https://msdn.microsoft.com/en- us/library/dd409389.aspx  UML Sequence Diagrams: Reference  https://msdn.microsoft.com/en- us/library/dd409377.aspx https://msdn.microsoft.com/en- us/library/dd409377.aspx  Sequence Diagrams http://www.uml-diagrams.org/sequence- diagrams.html http://www.uml-diagrams.org/sequence- diagrams.html  UML Sequence Diagrams Examples http://www.uml-diagrams.org/sequence- diagrams-examples.html http://www.uml-diagrams.org/sequence- diagrams-examples.html

27 Karolina Muszyńska Based on: : http://kolos.math.uni.lodz.pl/~pablo/seminarium/UML.pdf, http://edu.pjwstk.edu.pl/wyklady/pri/scb/index169.html

28 In order to implement an object-oriented database we need to transform the class diagram into a Physical Data Model. As a result of this transformation we obtain the following results: 1.Attributes of the classes become columns and the attributes which are defined as class identifiers become primary keys (PK) – for the classes which had no identifiers defined we must define primary keys (possibly add an additional column for that purpose) 2.If the class has methods/operations they become procedures 28

29 Results of the transformation of a class diagram into a physical data model: 3.Associations are transformed into relations among tables depending on the multiplicity:  associations (0..1; 1-1) are transformed into 1:1 relationships among tables; the link is between the primary keys of both tables  associations (1-0..*; 1-1..*) are transformed into 1:N relationships among tables where the PK on the side of „1” is linked with the foreign key on the side of „N” – this foreign key is usually a new column which is not present in the class diagram  associations (0..*-1..*) are transformed into N:M relationships among tables, which requires creation of an additional linking table 29

30 Results of the transformation of a class diagram into a physical data model: 4.Aggregation is transformed in the same way as an association with the multiplicity 0..1–1..* or 0..1-0..* - that means into 1:N relationship 5.Composition is treated in the same way as aggregation 30

31 Results of the transformation of a class diagram into a physical data model: 6.Inheritance can be mapped in three possibile ways:  A separate table is created for the superclass and for each subclass and they are linked with 1:1 relationships where the primary key is also the foreign key  Tables only for the subclasses are created and they include all the attributes from the superclass – synchronization among tables must be handled  Only one table is created which includes all attributes from the superclass and all subclasses – problem of numerous null values 31

32 32

33 33


Download ppt "Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”"

Similar presentations


Ads by Google