UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

Activity Diagrams in UML. Definition Activity diagrams represent the dynamics of the system. They are flow charts that are used to show the workflow of.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Interaction Diagrams Activity Diagram State Machine Diagram
Lecture 5a: Sequence Interaction Diagrams CSE 111 Copyright W. Howden1.
SE 555 Software Requirements & Specification 1 Activity Diagrams.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Modern Systems Analysis and Design Fifth Edition Jeffrey A
SE-565 Software System Requirements More UML Diagrams.
Blaha and Rumbaugh Sections 7.2 and 8.2
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Interaction Modeling. Sequence Models  There are two kinds of sequence models: scenarios and sequence diagrams  A scenario is a sequence of events that.
Sequence Diagram Tutorial
CS3773 Software Engineering
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
CS 325: Software Engineering March 3, 2015 Activity Modeling for Transformational Systems Trtansformational Systems UML Activity Diagrams.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
Chapter 5 – System Modeling
1 On to Object Design Chapter 14 Applying UML and Patterns.
UNIT- Venkata Ratnam K1 BEHAVIORAL MODELING.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Interaction Models (2): Sequence Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh 1.
Activity diagrams. Introduction ● Activity diagrams are a behavioural model that represent the dynamics of the system. ● An activity diagram is essentially.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
1 An Introduction to UML Interaction (Sequence and Communication) Diagrams Georgia State University CIS 3300 Spring, 2009.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
© 2008 Prentice Hall, Ovidiu Noran Lecture 7b 1 Modelling OO Logic Requirements: Sequence Diagrams and Activity Diagrams (Textbook Chapter 8, Appendix)
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Sequence Diagrams And Collaboration Diagrams HungNM.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
Lecture 2: Information Engineering Dr. Taysir Hassan Abdel Hamid October 12, 2015.
Chapter 3: Introducing the UML
UML - Development Process 1 Software Development Process Using UML.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
More on UML 1. 1.Use-case diagram 2.Class diagram [Object diagram] (static) 1.1 Domain/analysis model – of reality 1.2 Design model – of decisions 3.
Appendix 3 Object-Oriented Analysis and Design
UML Diagrams By Daniel Damaris Novarianto S..
Unified Modeling Language
Activity and State Transition Diagram
Prepared By Sidra Noureen
Visit for more Learning Resources
UML Diagrams Jung Woo.
Activity Diagrams Activity diagrams describe the workflow behavior of a system.  The diagrams describe the state of activities by showing the sequence.
Business System Development
Sequence Diagrams.
Requirements To Design In This Iteration
CIS 375 Bruce R. Maxim UM-Dearborn
Unified Modelling Language
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore

Lecture Agenda  Activity Diagrams  Sequence Diagrams  Collaboration Diagrams

Activity Diagram Intended to model workflows An activity diagram in the use-case model illustrates the flow of events of a use case  Similar to traditional flowchart but permits concurrent control in addition to sequential  An activity is shown as a box with rounded ends containing description of activity  Simple completion transition are shown as arrows  Branches are shown as guard condition or diamond

Activity Diagram  Fork / Join / Synchronization bar  If an activity has more than one output value or successor control flow, arrows are drawn from the fork symbol  Multiple inputs are drawn to a join symbol  Swimlanes  Organizing activities according to responsibilities into groups

Activity Diagram

Branching A branch has one incoming transition and two or more outgoing transitions: Charge credit card Hold in will-callMail tickets [today  7 days before show] [today < 7 days before show]

Merging A merge has two or more incoming transitions and one outgoing transition: Customer sees show Mail tickets Customer picks up tickets

Forking A fork represents the splitting of a single flow of control into two or more concurrent flows of control: Receive order Process orderLog order

Joining A join represents the synchronization of two or more flows of control into one sequential flow of control: Pay bill Receive BillReceive product

Swimlanes Swimlanes partition groups of activities based on, for instance, business organizations: Pay bill Receive BillReceive product CustomerBilling

Use Case Realization  Specification  Describes the behavior or structure of something without determining how the behavior will be implemented.  Realize:  To provide the implementation of a specific element  Realization:  Relationship between a specification and implementation  Specification elements such as use case and interface are realized in collaboration or classes (implementation element)  A use case specifies externally visible functionality and behavioral sequences, but it does not supply an implementation.  A collaboration describes the objects that implement the use case behavior and the way that they will interact to do it. Usually one collaboration implements one use case.

Collaboration-Interaction-Message  Collaboration  Description of a collection of objects that interact to implement some behavior within a context  An object may play more than one role in the same collaboration  Has both structural and behavioral aspect  Behavioral aspect is the set of messages exchanged by the object bound to roles  Also used to specify a software pattern / parameterized collaboration  Interaction  Set of messages within a collaboration  A behavior that comprises a set of messages, exchanged among a set of objects, to accomplish a specific purpose.  Message  Communication between two objects  Flow of control from a sender to a receiver  May have parameters that convey values between the objects  Adding message means adding responsibility to object receiving message

Interaction Diagrams  An interaction diagram shows an interaction, consisting of a set of objects and their relationships, including the messages that may be exchanged between them  Shows step-by-step one of the flows through a use case  So several interaction diagrams for one use case – one for each alternative  Contains lot of same details as in flow of events but the information is presented in a way more useful to the developers  Focused on objects that will be created to implement the functionality spelled out in use cases  Can show objects, classes or both.  Model the dynamic aspect of the system  Contain two sort of diagrams:  Sequence diagram Show the messages objects send to each other in a timely manner  Collaboration diagram Show the organization of the objects participating in an interaction

Sequence versus Collaboration  Semantically both are the same  Express different aspects of model  Sequence diagram expresses time ordering  Collaboration diagram is used to define class behavior

Finding Objects  Objects  Something that encapsulates information & behavior  One way is to look for nouns in flow of events  Another good place is to look into scenario documents A scenario is a specific instance of flow of events Example: ‘x’ withdraws money ; ‘x’ tries but pin is wrong Not all objects can be found in flow of events How objects interact in scenario are depicted in interactions Scenario description in textual form is not part of UML. Its interaction diagrams

Sequence Diagram  A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.  Each sequence diagram represents one of the flows through a use case  Displays interaction as 2D chart  Vertical dimension is the time axis, time proceeds down the page  Horizontal dimension shows the classifier roles that represents individual objects in the collaboration  No significance of horizontal ordering of the object  Lifeline  A vertical dashed line that represents the lifetime of an object.  During the time an object exists, the role is shown by dashed line  During the time an activation of the procedure on the object is active the lifeline is drawn as a double line (focus of control)  A message is shown as an arrow from the lifeline of one object to that of another  Each message represents one object making a function call to another  Each message will become an operation later (in the class of that object)  Message can be reflexive showing an object is calling one of its own operation  The arrows are arranged in time sequence down the diagram

Sequence Diagram  Activation  Execution of procedure including the time it waits for nested procedures to execute.  Shown by double line replacing part of lifeline

Sequence Diagram

Additional Features  Iteration  Consider an order which has several line items. When the order is cancelled, it must cancel each line items.  An interaction diagram for such a scenario could include multiple line item objects with the Order sending a cancel message to each of them  UML provide notation for multiple instance for interaction diagrams but Rose shows only in collaboration diagram

Interaction Diagrams – Object Props.  Object Persistence  Persistent Object will be saved to database or some other form of persistent storage. Implies that object will continue to exist even after the program has terminated  Static Object stays in memory until the program is terminated. Implies that it lives beyond the execution of sequence diagram but is not saved to persistent storage  Transient Object stays in memory only for short time. For example until the logic of sequence diagram has finished  Multiple Instance  Rose option: like list of employees  Separate icon to show multiple instances  Rose uses single instance icon on sequence diagram

Sequence Diagram - Message  Message can be added by drawing an arrow between the lifelines of two objects OR  From an object’s lifeline to itself (reflexive)  Message number can be shown as well (tools->options->diagram)  Focus of control shows the period of time during which an object is performing an action, either directly or through an underlying procedure.  The length of a FOC indicates the amount of time it takes for a message to be performed (only in SD).  When a message is moved vertically, each dependent message will move vertically as well.

Sequence Diagram - Message  Message Frequency  Periodic Message is sent on regular, periodic basis  Aperiodic Message is not sent on a regular basis either sent once or at irregular point in time

Sequence Diagram - Message  Synchronization  Simple In sequential systems message passing is simple. Message runs in a single thread of control  Synchronous An operation commences only when the sender has initiated the action and the receiver is ready to accept the message. Sender and receiver wait for each other until both are ready to proceed.  Asynchronous An operation commences regardless of whether the receiver is expecting the message or not.  Balking Like synchronous, but the sender will abandon the operation if the receiver is not ready.  Time-out Like synchronous, but the sender will only wait a specific amount of time for the receiver to be ready.  Notes  Can be added to diagram (objects) to add comment without affecting code generation

Class Exercise  Consider a use case which describes making a phone call. The caller initiates the use case and receiver is a secondary actor. The system the caller and receiver interact is the phone system. Consider a normal flow:  The use case begins when caller picks up the phone  Caller listens for dial tone (Alternate: no dial tone)  Caller dials a number  Phone system rings receiver’s phone (alternate: wrong number)  Receiver answers (alternate: no answer)  Caller conducts conversation  The use case ends when caller hangs up phone 

Class Exercise – Sequence Diagram

Cont. – Collaboration Diagram

Class Exercise  ATM (see Rose)

Collaboration Diagram  A collaboration diagram is an interaction diagram that emphasizes the organization of the objects that participate in the interaction.

Collaboration Diagram  Models the objects and links that are meaningful within an interaction  A classifier’s role describes an object  An association role describes a link  Messages are shown as arrows attached to the relationship lines connecting classifier roles  Sequence of messages is indicated by sequence numbers  Shows parameters and local variables of operation

Collaboration Diagram

Example  Car Lock system(Object Diagram)

Example

 Collaboration Diagram

THANK YOU