SlideShare a Scribd company logo
1 of 34
Sequence diagrams in UML
                                  (Unified Modeling Language)

                                                                                                     http://www.paxcel.net




                                                                                                          By:-
                                                                                          Tanjot Singh Sandhu


                                                                                     Paxcel technologies. www.paxcel.net
This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Open questions
1. How to represent 'internal' and 'protected internal' members inside a CD?




For “protected internal”, we can either use a stereotype or some other special
symbol/ image.
2. How to represent a nested class?
 (a) It can be represented as a normal class member.




                                                                                                          Paxcel technologies. www.paxcel.net
                     This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Open questions (Continued)
(b) We can use containment arrow, if we need to define the structure of nested
class.




3. Is aggregation a strong form or week form of plain association?
Aggregation is a specialized form of Association. It is relatively weak form of
    “whole-part”, because no statement is made about lifecycle dependency or
    creation/ destruction responsibility.
4. What is the difference between aggregation and containment?
Aggregation shows the relation between two separate classes whereas containment
    is for outer-inner class representation or package-class representation.
5. What is a reflexive relationship?
A class can also be associated with itself, using a reflexive association.




                                                                                                         Paxcel technologies. www.paxcel.net
                    This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
What is a Sequence Diagram?

   UML sequence diagrams are a dynamic modeling
    technique.
   Used primarily to show the interactions between objects in
    the sequential order.
   Use cases are often refined into one or more sequence
    diagrams.
   A business-level sequence diagram can be used as a
    requirement document to communicate requirements for
    a future system implementation.
   Can be used to document how objects in an existing (call
    it "legacy") system currently interact. This documentation
    is very useful when transitioning a system to another
    person or organization.
                                                                                                     Paxcel technologies. www.paxcel.net
                This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Drawing a Sequence Diagram
   A visual border (called frame element) is used to
    visualize a sequence diagram.
   Incoming and outgoing messages (a.k.a. interactions)
    for a sequence can be modeled by connecting the
    messages to the border of the frame element.
                                  Fig: Sequence Diagram




                                                                                                    Paxcel technologies. www.paxcel.net
               This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Drawing a Sequence Diagram (Continued)

   Diagram's label begins with the letters "sd," for Sequence
    Diagram.
   When using a frame element to enclose a diagram, the
    diagram's label needs to follow the format of:
                               Diagram Type Diagram Name

   The UML specification provides specific text values for
    diagram types (e.g., sd = Sequence Diagram, activity =
    Activity Diagram, and use case = Use Case Diagram).




                                                                                                      Paxcel technologies. www.paxcel.net
                 This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Constituents of a Sequence Diagram

   The main purpose of a sequence diagram is to define
    event sequences that result in some desired outcome.
   The focus is on the order in which messages occur.
   Horizontal and vertical dimensions are used to draw an
    SD.
   Vertical dimension shows the time sequence of
    messages/ calls as they occur.
   Horizontal dimension shows, left to right, the object
    instances that the messages are sent to.
   The basic constitutes of an SD include :
                        –       Lifelines
                        –       Messages
                        –       Guards
                        –       Combined fragments (alternatives, options, loops etc.)
                                                                                                     Paxcel technologies. www.paxcel.net
                This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Lifeline
   A lifeline represent either roles or object instances that
    participate in the sequence being modeled.
   Lifeline notation elements are placed at the top of the
    diagram.
   Lifelines are drawn as a box with a dashed line
    descending from the center of the bottom edge.
   The lifeline's name is placed inside the box.
   The UML standard for naming a lifeline follows the
    format of:
                               Instance Name : Class Name

   An example of lifeline diagram is shown in the following
    figure:

                                                                                                      Paxcel technologies. www.paxcel.net
                 This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Lifeline (Continued)




        Figure: Student class used in a lifeline whose instance name is freshman

   An underline defines that the lifeline represents a
    specific instance of a class in a sequence diagram, and
    not a particular kind of instance (i.e., a role).
   Instance names in sequence diagrams are underlined;
    roles names are not.
   A lifeline can be used to represent an anonymous or
    unnamed instance.
                                                                                                       Paxcel technologies. www.paxcel.net
                  This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Message
   The first message of a sequence diagram always starts at
    the top and is typically located on the left side of the
    diagram for readability.
   Subsequent messages are then added to the diagram
    slightly lower then the previous message.
   To show an object (i.e. lifeline) sending a message to
    another object, draw a line to the receiving object with a
    solid arrowhead for a synchronous call.
   Use a stick arrowhead for an asynchronous call.
   The message/ method name is placed above the arrowed
    line.
   Response/ Return message is optional and is denoted by
    a dotted line with an open arrowhead back to the
    originating lifeline.                           Paxcel technologies. www.paxcel.net
                      This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Message Example




            Figure: An example of messages being sent between objects

   Besides just showing message calls above Figure
    includes return messages (optional).
   Use of return messages depends on the level of
    detail/abstraction that is being modeled.
   Sometimes an object will need to send a message to
    itself.
   To draw an object calling itself, connect the message
    back to the object itself.
                                                                                                       Paxcel technologies. www.paxcel.net
                  This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Message Example (Continued)

   The following Figure shows the system object calling its
    determineAvailableReports method.
   The model draws attention to the fact that this processing
    takes place in the system object.




        Figure: The system object calling its determineAvailableReports method.
                                                                                                         Paxcel technologies. www.paxcel.net
                    This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Synchronous VS Asynchronous Messages




•Figure: A synchronous and an asynchronous message being sent to instance2.




                                                                                                    Paxcel technologies. www.paxcel.net
               This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Guards

   Guard is a condition, that must be met for a message to be
    sent to the object.
   Guards are used throughout UML diagrams to control flow.
   Place the guard element above the message line being
    guarded and in front of the message name.
   The notation of a guard is very simple; the format is:
                                            [Boolean Test]
   For example,
                                     [pastDueBalance = 0]




                                                                                                     Paxcel technologies. www.paxcel.net
                This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Guards - Example




    Figure: A segment sequence diagram in which the addStudent message has a guard

   In Figure above, the guard is the text "[pastDueBalance =
    0]."
   addStudent message will only be sent if the accounts
    receivable system returns a past due balance of zero.



                                                                                                         Paxcel technologies. www.paxcel.net
                    This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Combined fragments - alternatives
   UML 1.x "in-line" guard is not sufficient to handle the logic
    required for a sequence being modeled.
   UML 2 has addressed this problem by removing the "in-
    line" guard and adding a notation element called a
    Combined Fragment.
   A combined fragment is used to group sets of messages
    together to show conditional flow in a sequence diagram.
   The UML 2 specification identifies 11 interaction types for
    combined fragments.
   Alternatives are used to designate a mutually exclusive
    choice between two or more message sequences.
   Alternatives allow the modeling of the classic "if then
    else" logic (e.g., if I buy three items, then I get 20% off
    my purchase; else I get 10% off my purchase).
                                                                                                     Paxcel technologies. www.paxcel.net
                This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Alternatives - Example




Figure: A sequence diagram fragment that contains an alternative combination fragment
                                                                                                        Paxcel technologies. www.paxcel.net
                   This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
   In last Figure, an alternative combination fragment
    element is drawn using a frame.
   The word "alt" is placed inside the frame's namebox.
   The larger rectangle is then divided into what UML 2 calls
    operands.
   Operands are separated by a dashed line.
   Each operand is given a guard to test against, and this
    guard is placed towards the top left section of the
    operand on top of a lifeline. [Note: Usually, the lifeline to
    which the guard is attached is the lifeline that owns the
    variable that is included in the guard expression.]
   If an operand's guard equates to "true," then that operand
    is the operand to follow.
                                                                                                      Paxcel technologies. www.paxcel.net
                 This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
   Bank object is getting the check's amount and the
    account's balance.
   At this point in the sequence the alternative combination
    fragment takes over. Because of the guard "[balance >=
    amount]," if the account's balance is greater than or equal
    to the amount, then the sequence continues with the bank
    object sending the addDebitTransaction and
    storePhotoOfCheck messages to the account object.
   However, if the balance is not greater than or equal to the
    amount, then the sequence proceeds with the bank object
    sending the addInsuffientFundFee and
    noteReturnedCheck message to the account object and
    the returnCheck message to itself.

                                                                                                     Paxcel technologies. www.paxcel.net
                This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
   The second sequence is called when the balance is not
    greater than or equal to the amount because of the
    "[else]" guard.
   In alternative combination fragments, the "[else]" guard is
    not required; and if an operand does not have an explicit
    guard on it, then the "[else]" guard is to be assumed.
   Alternative combination fragments are not limited to
    simple "if then else" tests.
   There can be as many alternative paths as are needed.
   If more alternatives are needed, all you must do is add an
    operand to the rectangle with that sequence's guard and
    messages.

                                                                                                     Paxcel technologies. www.paxcel.net
                This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Option
   The option combination fragment is used to model a
    sequence that will either occur or will not occur.
   An option is used to model a simple "if then" statement
    (i.e., if there are fewer than five donuts on the shelf, then
    make two dozen more donuts).
   It only has one operand and there never can be an "else"
    guard.
   To draw an option combination you draw a frame - text
    "opt" is placed inside the frame's namebox, and in the
    frame's content area the option's guard is placed towards
    the top left corner on top of a lifeline.
   Then the option's sequence of messages is placed in the
    remainder of the frame's content area.
   These elements are illustrated in following Figure.
                                                                                                        Paxcel technologies. www.paxcel.net
                   This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Option - Example




Figure: A sequence diagram fragment that includes an option combination fragment




                                                                                                       Paxcel technologies. www.paxcel.net
                  This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Option – Example
   If a student's past due balance equals zero, then the
    addStudent, getCostOfClass, and chargeForClass
    messages are sent.
   If the student's past due balance does not equal zero, then
    the sequence skips sending any of the messages in the
    option combination fragment.
   The example in last figure sequence diagram fragment
    includes a guard for the option; however, the guard is not a
    required element.
   In high-level, abstract sequence diagrams you might not
    want to specify the condition of the option. You may simply
    want to indicate that the fragment is optional.


                                                                                                       Paxcel technologies. www.paxcel.net
                  This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Loops
   To model a repetitive sequence.
   In frame's namebox the text "loop" is placed.
   Inside the frame's content area the loop's guard is placed.
   Then the loop's sequence of messages is placed in the
    remainder of the frame's content area.
   In a loop, a guard can have two special conditions tested
    against, in addition to the standard Boolean test.
   The special guard conditions are minimum iterations
    written as "minint = [the number]" (e.g., "minint = 1") and
    maximum iterations written as "maxint = [the number]“.
   With a minimum iterations guard, the loop must execute at
    least the number of times indicated, whereas with a
    maximum iterations guard the number of loop executions
    cannot exceed the number.
                                                                                                      Paxcel technologies. www.paxcel.net
                 This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Loops - Example




•Figure: An example sequence diagram with a loop combination fragment

                                                                                                 Paxcel technologies. www.paxcel.net
            This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Loops – Example
   The loop shown in last figure executes until the reportsEnu
    object's hasAnotherReport message returns false.
   The loop in this sequence diagram uses a Boolean test to
    verify if the loop sequence should be run.
   To read this diagram, you start at the top, as normal. When
    you get to the loop combination fragment a test is done to
    see if the value hasAnotherReport equals true.
   If the hasAnotherReport value equals true, then the
    sequence goes into the loop fragment.
   You can then follow the messages in the loop as you would
    normally do in a sequence diagram .



                                                                                                       Paxcel technologies. www.paxcel.net
                  This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Referencing another sequence diagram
   In UML 2, the "Interaction Occurrence" element was
    introduced.
   Interaction occurrences add the ability to compose primitive
    sequence diagrams into complex sequence diagrams.
   An interaction occurrence element is drawn using a frame,
    text "ref" is placed inside the frame's namebox.
   Name of the sequence diagram being referenced is placed
    inside the frame's content area along with any parameters
    to the sequence diagram.
   The notation of the referenced sequence diagram's name
    follows the pattern of:
             sequence diagram name[(arguments)] [: return value]



                                                                                                        Paxcel technologies. www.paxcel.net
                   This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Referencing another sequence diagram - Example




  Figure: A sequence diagram that references two different sequence diagrams

                                                                                                        Paxcel technologies. www.paxcel.net
                   This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Gates
   Gates can be an easy way to model the passing of
    information between a sequence diagram and its context.
   A gate is merely a message that is illustrated with one end
    connected to the sequence diagram's frame's edge and the
    other end connected to a lifeline.
   Gates - entry gate (getBalance) and exit gate (balance).




                  •   Figure: A sequence diagram with gates.
                                                                                                       Paxcel technologies. www.paxcel.net
                  This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Break
   Identical in every way to the option combined fragment, with two
    exceptions.
   First, frame has a namebox with the text "break" instead of
    "option”.
   Second, when a break combined fragment's message is to be
    executed, the enclosing interaction's remainder messages will
    not be executed because the sequence breaks out of the
    enclosing interaction.
   Thus break combined fragment is much like the break keyword
    in a programming language like C++ or Java.




                     •Figure: A sequence diagram with gates.

                                                                                                        Paxcel technologies. www.paxcel.net
                   This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Break - Example




Figure: A sequence diagram with the fragment using a break.
                                                                                              Paxcel technologies. www.paxcel.net
         This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Parallel
   Modern computer systems are advancing in complexity and
    at times perform concurrent tasks.
   Parallel element is used for creating a sequence diagram
    that shows parallel processing activities.
   Drawn using a frame and place the text "par" in the frame's
    namebox.
   Break up the frame's content section into horizontal
    operands separated by a dashed line.
   Each operand in the frame represents a thread of
    execution done in parallel.




                                                                                                      Paxcel technologies. www.paxcel.net
                 This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
Parallel - Example




    •   Figure: A microwave is an example of an object that does two tasks in parallel
   A hungryPerson sends the cookFood message to the oven
    object. Oven object sends two messages to itself at the
    same time (nukeFood and rotateFood). After both of these
    messages are done, the hungryPerson object is returned
    yummyFood from the oven object.
                                                                                                               Paxcel technologies. www.paxcel.net
                          This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
References
   http://www.ibm.com/developerworks/rational/library/3101.html
   http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell
    /
   http://stackoverflow.com/questions/3434034/how-to-show-protected-internal-in-uml
   http://www.holub.com/goodies/uml/
   http://code.google.com/a/eclipselabs.org/p/javadocasumlview/wiki/JavaToUMLDesc
    ription
   http://books.google.co.in/books?id=M856gzs7L3gC&pg=PA13&lpg=PA13&dq=is+ag
    gregation+strong+or+weak+form+of+association&source=bl&ots=pm4zv9-
    wIe&sig=EOi8f0v9o5r4syaoHlOg_Wr8RNM&hl=en&sa=X&ei=ww2VT_mILMHWrQf
    GtumkBQ&ved=0CEMQ6AEwBQ#v=snippet&q=is%20aggregation%20strong%20or
    %20weak%20form%20of%20association&f=false




                                                                                                            Paxcel technologies. www.paxcel.net
                       This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.

More Related Content

What's hot

Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagramRamakant Soni
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramAshesh R
 
UML Class Diagram Notation
UML Class Diagram NotationUML Class Diagram Notation
UML Class Diagram Notationadnan12345678
 
Object diagram
Object diagramObject diagram
Object diagramRahul Pola
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Ramakant Soni
 
classes & objects introduction
classes & objects introductionclasses & objects introduction
classes & objects introductionKumar
 
Lecture11 use case sequence diagram
Lecture11 use case sequence diagramLecture11 use case sequence diagram
Lecture11 use case sequence diagramShahid Riaz
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity DiagramNiloy Rocker
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialCreately
 
Activity diagram tutorial
Activity diagram tutorialActivity diagram tutorial
Activity diagram tutorialDeclan Chellar
 
SAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsSAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsMichael Heron
 

What's hot (20)

Uml Common Mechanism
Uml Common MechanismUml Common Mechanism
Uml Common Mechanism
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Uml class Diagram
Uml class DiagramUml class Diagram
Uml class Diagram
 
UML Class Diagram Notation
UML Class Diagram NotationUML Class Diagram Notation
UML Class Diagram Notation
 
Diagrams
DiagramsDiagrams
Diagrams
 
Object diagram
Object diagramObject diagram
Object diagram
 
Uml
UmlUml
Uml
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
classes & objects introduction
classes & objects introductionclasses & objects introduction
classes & objects introduction
 
Lecture11 use case sequence diagram
Lecture11 use case sequence diagramLecture11 use case sequence diagram
Lecture11 use case sequence diagram
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity Diagram
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram Tutorial
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Activity diagram tutorial
Activity diagram tutorialActivity diagram tutorial
Activity diagram tutorial
 
SAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsSAD11 - Sequence Diagrams
SAD11 - Sequence Diagrams
 

Similar to Sequence diagrams in UML

Pertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramPertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramAbi Bobon
 
Object oriented modelling
Object oriented modellingObject oriented modelling
Object oriented modellingsujithmv1
 
Module 1 uml - interaction diagram
Module 1   uml - interaction diagramModule 1   uml - interaction diagram
Module 1 uml - interaction diagramktuonlinenotes
 
Architecture and design
Architecture and designArchitecture and design
Architecture and designhimanshu_airon
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligencewasim liam
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISEsreeja_rajesh
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III pkaviya
 
Lab # 06
Lab # 06Lab # 06
Lab # 06Mr SMAK
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagramSadhana28
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 
ActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsSaurabh Narula
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software EngineeringAmit Singh
 

Similar to Sequence diagrams in UML (20)

Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Pertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramPertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagram
 
Object oriented modelling
Object oriented modellingObject oriented modelling
Object oriented modelling
 
Module 1 uml - interaction diagram
Module 1   uml - interaction diagramModule 1   uml - interaction diagram
Module 1 uml - interaction diagram
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
 
Uml basics
Uml basicsUml basics
Uml basics
 
Uml basics
Uml basicsUml basics
Uml basics
 
Interfaces & Packages V2
Interfaces & Packages V2Interfaces & Packages V2
Interfaces & Packages V2
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISESoftware Architecture and Project Management module III : PATTERN OF ENTERPRISE
Software Architecture and Project Management module III : PATTERN OF ENTERPRISE
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III
 
Lab # 06
Lab # 06Lab # 06
Lab # 06
 
Ooad unit 1
Ooad unit 1Ooad unit 1
Ooad unit 1
 
Ood Post1
Ood Post1Ood Post1
Ood Post1
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagram
 
Java mcq
Java mcqJava mcq
Java mcq
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
LANSim
LANSimLANSim
LANSim
 
ActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsActionScript 3.0 Fundamentals
ActionScript 3.0 Fundamentals
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
 

More from Paxcel Technologies

Binary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningBinary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningPaxcel Technologies
 
Ssrs 2012(powerview) installation ans configuration
Ssrs 2012(powerview) installation ans configurationSsrs 2012(powerview) installation ans configuration
Ssrs 2012(powerview) installation ans configurationPaxcel Technologies
 
Paxcel Mobile development Portfolio
Paxcel Mobile development PortfolioPaxcel Mobile development Portfolio
Paxcel Mobile development PortfolioPaxcel Technologies
 
Risk Oriented Testing of Web-Based Applications
Risk Oriented Testing of Web-Based ApplicationsRisk Oriented Testing of Web-Based Applications
Risk Oriented Testing of Web-Based ApplicationsPaxcel Technologies
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Paxcel Technologies
 

More from Paxcel Technologies (10)

Binary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningBinary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine Learning
 
Async pattern
Async patternAsync pattern
Async pattern
 
Window phone 8 introduction
Window phone 8 introductionWindow phone 8 introduction
Window phone 8 introduction
 
Ssrs 2012(powerview) installation ans configuration
Ssrs 2012(powerview) installation ans configurationSsrs 2012(powerview) installation ans configuration
Ssrs 2012(powerview) installation ans configuration
 
Paxcel Mobile development Portfolio
Paxcel Mobile development PortfolioPaxcel Mobile development Portfolio
Paxcel Mobile development Portfolio
 
Risk Oriented Testing of Web-Based Applications
Risk Oriented Testing of Web-Based ApplicationsRisk Oriented Testing of Web-Based Applications
Risk Oriented Testing of Web-Based Applications
 
Knockout.js explained
Knockout.js explainedKnockout.js explained
Knockout.js explained
 
All about Contactless payments
All about Contactless paymentsAll about Contactless payments
All about Contactless payments
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1
 
Paxcel Snapshot
Paxcel SnapshotPaxcel Snapshot
Paxcel Snapshot
 

Recently uploaded

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Sequence diagrams in UML

  • 1. Sequence diagrams in UML (Unified Modeling Language) http://www.paxcel.net By:- Tanjot Singh Sandhu Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 2. Open questions 1. How to represent 'internal' and 'protected internal' members inside a CD? For “protected internal”, we can either use a stereotype or some other special symbol/ image. 2. How to represent a nested class? (a) It can be represented as a normal class member. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 3. Open questions (Continued) (b) We can use containment arrow, if we need to define the structure of nested class. 3. Is aggregation a strong form or week form of plain association? Aggregation is a specialized form of Association. It is relatively weak form of “whole-part”, because no statement is made about lifecycle dependency or creation/ destruction responsibility. 4. What is the difference between aggregation and containment? Aggregation shows the relation between two separate classes whereas containment is for outer-inner class representation or package-class representation. 5. What is a reflexive relationship? A class can also be associated with itself, using a reflexive association. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 4. What is a Sequence Diagram?  UML sequence diagrams are a dynamic modeling technique.  Used primarily to show the interactions between objects in the sequential order.  Use cases are often refined into one or more sequence diagrams.  A business-level sequence diagram can be used as a requirement document to communicate requirements for a future system implementation.  Can be used to document how objects in an existing (call it "legacy") system currently interact. This documentation is very useful when transitioning a system to another person or organization. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 5. Drawing a Sequence Diagram  A visual border (called frame element) is used to visualize a sequence diagram.  Incoming and outgoing messages (a.k.a. interactions) for a sequence can be modeled by connecting the messages to the border of the frame element. Fig: Sequence Diagram Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 6. Drawing a Sequence Diagram (Continued)  Diagram's label begins with the letters "sd," for Sequence Diagram.  When using a frame element to enclose a diagram, the diagram's label needs to follow the format of: Diagram Type Diagram Name  The UML specification provides specific text values for diagram types (e.g., sd = Sequence Diagram, activity = Activity Diagram, and use case = Use Case Diagram). Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 7. Constituents of a Sequence Diagram  The main purpose of a sequence diagram is to define event sequences that result in some desired outcome.  The focus is on the order in which messages occur.  Horizontal and vertical dimensions are used to draw an SD.  Vertical dimension shows the time sequence of messages/ calls as they occur.  Horizontal dimension shows, left to right, the object instances that the messages are sent to.  The basic constitutes of an SD include : – Lifelines – Messages – Guards – Combined fragments (alternatives, options, loops etc.) Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 8. Lifeline  A lifeline represent either roles or object instances that participate in the sequence being modeled.  Lifeline notation elements are placed at the top of the diagram.  Lifelines are drawn as a box with a dashed line descending from the center of the bottom edge.  The lifeline's name is placed inside the box.  The UML standard for naming a lifeline follows the format of: Instance Name : Class Name  An example of lifeline diagram is shown in the following figure: Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 9. Lifeline (Continued) Figure: Student class used in a lifeline whose instance name is freshman  An underline defines that the lifeline represents a specific instance of a class in a sequence diagram, and not a particular kind of instance (i.e., a role).  Instance names in sequence diagrams are underlined; roles names are not.  A lifeline can be used to represent an anonymous or unnamed instance. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 10. Message  The first message of a sequence diagram always starts at the top and is typically located on the left side of the diagram for readability.  Subsequent messages are then added to the diagram slightly lower then the previous message.  To show an object (i.e. lifeline) sending a message to another object, draw a line to the receiving object with a solid arrowhead for a synchronous call.  Use a stick arrowhead for an asynchronous call.  The message/ method name is placed above the arrowed line.  Response/ Return message is optional and is denoted by a dotted line with an open arrowhead back to the originating lifeline. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 11. Message Example Figure: An example of messages being sent between objects  Besides just showing message calls above Figure includes return messages (optional).  Use of return messages depends on the level of detail/abstraction that is being modeled.  Sometimes an object will need to send a message to itself.  To draw an object calling itself, connect the message back to the object itself. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 12. Message Example (Continued)  The following Figure shows the system object calling its determineAvailableReports method.  The model draws attention to the fact that this processing takes place in the system object. Figure: The system object calling its determineAvailableReports method. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 13. Synchronous VS Asynchronous Messages •Figure: A synchronous and an asynchronous message being sent to instance2. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 14. Guards  Guard is a condition, that must be met for a message to be sent to the object.  Guards are used throughout UML diagrams to control flow.  Place the guard element above the message line being guarded and in front of the message name.  The notation of a guard is very simple; the format is: [Boolean Test]  For example, [pastDueBalance = 0] Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 15. Guards - Example Figure: A segment sequence diagram in which the addStudent message has a guard  In Figure above, the guard is the text "[pastDueBalance = 0]."  addStudent message will only be sent if the accounts receivable system returns a past due balance of zero. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 16. Combined fragments - alternatives  UML 1.x "in-line" guard is not sufficient to handle the logic required for a sequence being modeled.  UML 2 has addressed this problem by removing the "in- line" guard and adding a notation element called a Combined Fragment.  A combined fragment is used to group sets of messages together to show conditional flow in a sequence diagram.  The UML 2 specification identifies 11 interaction types for combined fragments.  Alternatives are used to designate a mutually exclusive choice between two or more message sequences.  Alternatives allow the modeling of the classic "if then else" logic (e.g., if I buy three items, then I get 20% off my purchase; else I get 10% off my purchase). Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 17. Alternatives - Example Figure: A sequence diagram fragment that contains an alternative combination fragment Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 18. In last Figure, an alternative combination fragment element is drawn using a frame.  The word "alt" is placed inside the frame's namebox.  The larger rectangle is then divided into what UML 2 calls operands.  Operands are separated by a dashed line.  Each operand is given a guard to test against, and this guard is placed towards the top left section of the operand on top of a lifeline. [Note: Usually, the lifeline to which the guard is attached is the lifeline that owns the variable that is included in the guard expression.]  If an operand's guard equates to "true," then that operand is the operand to follow. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 19. Bank object is getting the check's amount and the account's balance.  At this point in the sequence the alternative combination fragment takes over. Because of the guard "[balance >= amount]," if the account's balance is greater than or equal to the amount, then the sequence continues with the bank object sending the addDebitTransaction and storePhotoOfCheck messages to the account object.  However, if the balance is not greater than or equal to the amount, then the sequence proceeds with the bank object sending the addInsuffientFundFee and noteReturnedCheck message to the account object and the returnCheck message to itself. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 20. The second sequence is called when the balance is not greater than or equal to the amount because of the "[else]" guard.  In alternative combination fragments, the "[else]" guard is not required; and if an operand does not have an explicit guard on it, then the "[else]" guard is to be assumed.  Alternative combination fragments are not limited to simple "if then else" tests.  There can be as many alternative paths as are needed.  If more alternatives are needed, all you must do is add an operand to the rectangle with that sequence's guard and messages. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 21. Option  The option combination fragment is used to model a sequence that will either occur or will not occur.  An option is used to model a simple "if then" statement (i.e., if there are fewer than five donuts on the shelf, then make two dozen more donuts).  It only has one operand and there never can be an "else" guard.  To draw an option combination you draw a frame - text "opt" is placed inside the frame's namebox, and in the frame's content area the option's guard is placed towards the top left corner on top of a lifeline.  Then the option's sequence of messages is placed in the remainder of the frame's content area.  These elements are illustrated in following Figure. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 22. Option - Example Figure: A sequence diagram fragment that includes an option combination fragment Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 23. Option – Example  If a student's past due balance equals zero, then the addStudent, getCostOfClass, and chargeForClass messages are sent.  If the student's past due balance does not equal zero, then the sequence skips sending any of the messages in the option combination fragment.  The example in last figure sequence diagram fragment includes a guard for the option; however, the guard is not a required element.  In high-level, abstract sequence diagrams you might not want to specify the condition of the option. You may simply want to indicate that the fragment is optional. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 24. Loops  To model a repetitive sequence.  In frame's namebox the text "loop" is placed.  Inside the frame's content area the loop's guard is placed.  Then the loop's sequence of messages is placed in the remainder of the frame's content area.  In a loop, a guard can have two special conditions tested against, in addition to the standard Boolean test.  The special guard conditions are minimum iterations written as "minint = [the number]" (e.g., "minint = 1") and maximum iterations written as "maxint = [the number]“.  With a minimum iterations guard, the loop must execute at least the number of times indicated, whereas with a maximum iterations guard the number of loop executions cannot exceed the number. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 25. Loops - Example •Figure: An example sequence diagram with a loop combination fragment Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 26. Loops – Example  The loop shown in last figure executes until the reportsEnu object's hasAnotherReport message returns false.  The loop in this sequence diagram uses a Boolean test to verify if the loop sequence should be run.  To read this diagram, you start at the top, as normal. When you get to the loop combination fragment a test is done to see if the value hasAnotherReport equals true.  If the hasAnotherReport value equals true, then the sequence goes into the loop fragment.  You can then follow the messages in the loop as you would normally do in a sequence diagram . Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 27. Referencing another sequence diagram  In UML 2, the "Interaction Occurrence" element was introduced.  Interaction occurrences add the ability to compose primitive sequence diagrams into complex sequence diagrams.  An interaction occurrence element is drawn using a frame, text "ref" is placed inside the frame's namebox.  Name of the sequence diagram being referenced is placed inside the frame's content area along with any parameters to the sequence diagram.  The notation of the referenced sequence diagram's name follows the pattern of: sequence diagram name[(arguments)] [: return value] Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 28. Referencing another sequence diagram - Example Figure: A sequence diagram that references two different sequence diagrams Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 29. Gates  Gates can be an easy way to model the passing of information between a sequence diagram and its context.  A gate is merely a message that is illustrated with one end connected to the sequence diagram's frame's edge and the other end connected to a lifeline.  Gates - entry gate (getBalance) and exit gate (balance). • Figure: A sequence diagram with gates. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 30. Break  Identical in every way to the option combined fragment, with two exceptions.  First, frame has a namebox with the text "break" instead of "option”.  Second, when a break combined fragment's message is to be executed, the enclosing interaction's remainder messages will not be executed because the sequence breaks out of the enclosing interaction.  Thus break combined fragment is much like the break keyword in a programming language like C++ or Java. •Figure: A sequence diagram with gates. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 31. Break - Example Figure: A sequence diagram with the fragment using a break. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 32. Parallel  Modern computer systems are advancing in complexity and at times perform concurrent tasks.  Parallel element is used for creating a sequence diagram that shows parallel processing activities.  Drawn using a frame and place the text "par" in the frame's namebox.  Break up the frame's content section into horizontal operands separated by a dashed line.  Each operand in the frame represents a thread of execution done in parallel. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 33. Parallel - Example • Figure: A microwave is an example of an object that does two tasks in parallel  A hungryPerson sends the cookFood message to the oven object. Oven object sends two messages to itself at the same time (nukeFood and rotateFood). After both of these messages are done, the hungryPerson object is returned yummyFood from the oven object. Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.
  • 34. References  http://www.ibm.com/developerworks/rational/library/3101.html  http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell /  http://stackoverflow.com/questions/3434034/how-to-show-protected-internal-in-uml  http://www.holub.com/goodies/uml/  http://code.google.com/a/eclipselabs.org/p/javadocasumlview/wiki/JavaToUMLDesc ription  http://books.google.co.in/books?id=M856gzs7L3gC&pg=PA13&lpg=PA13&dq=is+ag gregation+strong+or+weak+form+of+association&source=bl&ots=pm4zv9- wIe&sig=EOi8f0v9o5r4syaoHlOg_Wr8RNM&hl=en&sa=X&ei=ww2VT_mILMHWrQf GtumkBQ&ved=0CEMQ6AEwBQ#v=snippet&q=is%20aggregation%20strong%20or %20weak%20form%20of%20association&f=false Paxcel technologies. www.paxcel.net This is the exclusive property of Paxcel Technologies. This may not be reproduced or given to third parties without their consent.