The Dynamic Model. An Introduction to UML. Enterprise Architect. by Geoffrey Sparks. All material (c) Geoffrey Sparks

Similar documents
How and Why to Use the Unified Modeling Language. among software components, architectural-based

Introduction to Software Engineering. 5. Modeling Objects and Classes

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

LESSON PLAN SUB NAME : OBJECT ORIENTED ANALYSIS AND DESIGN UNIT SYLLABUS

Software Service Engineering

16.1 Introduction... 2

Lecture 33 April 4, Unied Modelling Language. ECE155: Engineering Design with Embedded Systems Winter Patrick Lam version 1

Object-Oriented Software Development Goal and Scope

Designing Component-Based Architectures with Rational Rose RealTime

Engineering Design w/embedded Systems

UML Tutorial. Unified Modeling Language UML Tutorial

Object-Oriented Systems Analysis and Design Using UML

Outline of Unified Process

Introduction for using UML

Software Development Methodologies

UNIT-4 Behavioral Diagrams

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

Outline of UML and Unified Process. Object Oriented Analysis/Design/Programming UML1.5. Koichiro Ochimizu, JAIST. UML&UP outline 1.

Activities Radovan Cervenka

UML Views of a System

Interaction Modelling: Use Cases

Model Driven Development of Component Centric Applications

The Unified Modeling Language (UML)

INTRODUCTION TO UNIFIED MODELING MODEL (UML) & DFD. Slides by: Shree Jaswal

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

UNIT 5 - UML STATE DIAGRAMS AND MODELING

SEEM4570 System Design and Implementation. Lecture 10 UML

Activity Diagram Written Date : September 02, 2016

Basic Structural Modeling. Copyright Joey Paquet,

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

Software Engineering Lab Manual

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Layering Strategies. Peter Eeles RSO (UK) Rational Software Ltd. Version rd August 2001

Objectives. Explain the purpose and objectives of objectoriented. Develop design class diagrams

SEEM4570 System Design and Implementation Lecture 11 UML

Object-Oriented Design

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Today s Agenda UML. CompSci 280 S Introduction to Software Development. 1.Introduction UML Diagrams. Topics: Reading:

Research Review on Basic Principles of Unified Modelling Language

Software Design And Modeling BE 2015 (w. e. f Academic Year )

06. Analysis Modeling

Darshan Institute of Engineering & Technology for Diploma Studies

Object-Oriented and Classical Software Engineering

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Interaction Modelling: Sequence Diagrams

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Chapter : Analysis Modeling

Meltem Özturan

Deriving Model-to-Code Transformation Rules at the Meta- Model Level

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Topics. Kinds of UML models. Use case modeling. Actors. Actor. Assignment of reqs to actors and use cases

Unified Modeling Language (UML)

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

UML- a Brief Look UML and the Process

Introduction to Software Engineering. 5. Modeling Objects and Classes

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Software Life-Cycle Models

Extension to UML Using Stereotypes

(USE CASE MODELING) Use Case /.!.2. 2)$ 2 #use case modeling.

Software Engineering I (02161)

Architecture and the UML

New Features of UML2.0 UML2 UML2.0. Koichiro Ochimizu, JAIST UML Structured Classifier. Design View (Internal structure diagram)

Business Process Modeling. Version /10/2017

Overview of Sentence Order Reference Document Development Process

Producing Graphical User Interface from Activity Diagrams Ebitisam K. Elberkawi, Mohamed M. Elammari

Practical UML - A Hands-On Introduction for Developers

Interactions A link message

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

SRI VENKATESWARA COLLEGE OF ENGINERRING AND TECHNOLOGY THIRUPACHUR,THIRUVALLUR UNIT I OOAD PART A

Selection of UML Models for Test Case Generation: A Discussion on Techniques to Generate Test Cases

CHAPTER 5 ARCHITECTURAL DESIGN SE211 SOFTWARE DESIGN

Practical UML : A Hands-On Introduction for Developers

VISHNU INSTITUTE OF TECHNOLOGY Vishnupur, BHIMAVARAM

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

Software Engineering. Page 1. Objectives. Object-Behavioural Modelling. Analysis = Process + Models. Case Study: Event Identification

Unified Modeling Language (UML)

APPENDIX M INTRODUCTION TO THE UML

Enterprise Architect. User Guide Series. UML Models. Author: Sparx Systems. Date: 30/06/2017. Version: 1.0 CREATED WITH

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Chapter 4. Capturing the Requirements. 4th Edition. Shari L. Pfleeger Joanne M. Atlee

Structured and Object Oriented Analysis and Design

OO Using UML: Dynamic Models

Software Engineering

LABORATORY 1 REVISION

Getting started with WebRatio 6 BPM - WebRatio WebML Wiki

Approaches of using UML for Embedded System Design

UML Essentials Dynamic Modeling

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

22/09/2012 INFO2110. Copyright Warning. Revision of class diagram. Overview. Purpose of class diagram. Generalization Relationship

Enterprise Architect - UML Dictionary

Introduction to Software Engineering. ECSE-321 Unit 9 Architectural Design Approaches

1 Introduction. 1.1 Introduction

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Software Architecture and Design I

Business Process Modelling

Hippo Software BPMN and UML Training

BPMN Getting Started Guide

Lecture Notes UML UNIT-II. Subject: OOAD Semester: 8TH Course No: CSE-802

Transcription:

An Introduction to UML The Dynamic Model by Geoffrey Sparks All material (c) Geoffrey Sparks 2001 www.sparxsystems.com.au Geoffrey Sparks 2001 Page:1

Table of Contents THE DYNAMIC MODEL... 3 INTRODUCTION TO UML... 3 SEQUENCE DIAGRAMS... 3 Purpose... 3 Notation... 3 ACTIVITY DIAGRAMS... 5 Purpose... 5 Notation... 5 STATE CHARTS... 8 Purpose... 8 Example Notation... 8 SUMMARY... 9 RECOMMENDED READING... 10 Geoffrey Sparks 2001 Page:2

This paper describes how to model the dynamic aspects of software systems using UML notation and semantics. The three topics covered are sequence diagrams, activity diagrams and state charts. An explanation is given of each and how they fit into the overall model structure. Introduction to UML The Unified Modelling Language (UML) is, as its name implies, a modelling language and not a method or process. UML is made up of a very specific notation and the related grammatical rules for constructing software models. UML in itself does not proscribe or advise on how to use that notation in a software development process or as part of an object-oriented design methodology. This paper focuses on the modelling of dynamic behaviour using UML notation and semantics. Dynamic interaction and behaviour in UML is broken down into three main categories: 1. Interactions between object instances at run-time. This is modelled using Sequence diagram and/or Collaboration diagrams. This paper will only discuss Sequence diagrams, as Collaboration and Sequence diagrams are semantically identical. 2. General activity descriptions covering business process and user interaction. Activity diagrams and Business Process diagrams are used for this purpose. 3. State changes over time. UML supports State charts for modelling state changes. You can find out more about UML from the books mentioned in the suggested reading section and from the UML specification documents to be found at the Object Management Groups UML resource pages: http://www.omg.org/technology/uml/ and at http://www.omg.org/technology/documents/formal/ Sequence Diagrams Purpose Sequence diagrams are used to display the interaction between users, screens and object instances within the system. They provide a sequential map of message passing between objects over time. Frequently these diagrams are placed under Use Cases or Components in the model to illustrate a scenario, or common set of steps followed in response to an event that generates an outcome. The model includes what initiates activity in the system, what processing and changes occur internally and what outputs are generated. Often, the object instances are represented using special stereotyped icons - icons exist for boundary objects, controllers and persistent entities. Notation The notation used is typically a horizontally deployed set of actors and object instances, each having a vertical lifespan bar. Messages (usually method calls but may also Geoffrey Sparks 2001 Page:3

represent messages passed using message queuing services and other events) are drawn from one object to another with an arrow indicating the direction of flow. A Sequence diagram is representation of the messages passed between object instances, so generally the messages will map during the design phase of the project to class operations. The initial Sequence diagrams indicate what public behaviour is needed for objects to get work done and cooperate, and during design, Sequence diagrams are sued to show what actual responsibilities and operations are assigned to which classes. The example diagram below demonstrates some features of Sequence diagrams Customer Login Screen SecurityManager : Security Controller Login Users : Customer GetDocument ValidateCustomer [UserDetails] Arrows between components represent the flow of information and requests for services between users and components Validate [Result] GetName A message to sel f A customer will be required to login in to the book store prior to browsing and making selections. Note the use of stereotyped icons to display particular objects: for example the user interface (Login Screen) is displayed with a Boundary strereotype and the User as an Entity stereotype. These help visually differentiate object roles during analyis. Geoffrey Sparks 2001 Page:4

Activity Diagrams Purpose Activity diagrams are used to show how different work flows or processes in a system are constructed, how they start, the many decision paths that can be taken from start to finish and where parallel processing may occur during execution. An Activity diagram generally does not model the exact internal behaviour of a software system (like a Sequence diagram does) but rather it shows the general processes and pathways at a high level. Often it is used to model business activities (such as Selling Books or Manage Inventory), and may be at a very high level. Activities will generally be realised by one or more Use Cases, the Activity describes the process that is undertaken and the Use Case how an Actor will use the system to realise all or part of an Activity. Notation Activity Diagram Notation Standard UML notation uses a rectangle with rounded corners to depict an Activity. Activities may be joined by process flows or events. In addition, a Decision node can model divergent behaviour based on a condition. Typically a Start and End node are defined to complete the full Activity representation. Synchronisation points may also be defined to illustrate how processing may be carried out in parallel, then synchronised at a point before further activity is undertaken. The example below illustrates most of these points it describes the process surrounding the acquiring of a beverage from a vending machine. The rounded rectangles are Activities, the diamonds are Decision points and the horizontal black bars are synchronisation points. Note that if you were building drink vending machine software, only some of the activities are relevant, although the diagram as a whole provides a good picture of what the total process of getting a beverage is all about. Further analysis would be needed to determine which parts of this model could be implemented or supported in software. Geoffrey Sparks 2001 Page:5

Find Bev erage [no coffee] decision Start Put Coffee in Filter Add Water to Reserv oir Get Cups Get Can of Cola Put Filter in Machine This example is from "UML Distilled" by Martin Fowler, p. 130 [no cola] Turn on Machine Brew Coffee Pour Coffee Drink Bev erage End Business Process Notation In addition to the standard Activity diagram notation as described in UML, several extensions have been defined to more accurately portray business processes. In particular, the extensions proposed by Hans-Erik Eriksson and Magnus Penker (see suggested reading) provide a useful way of approaching this aspect of system analysis. These extensions provide further stereotypes such as business process (represented as an elongated rectangular arrow), goal, input and output objects. The example below shows how these elements may be combined to produce a high level picture of business activity. Geoffrey Sparks 2001 Page:6

Web Pages Book Catalogue User «goal» Take Customer Orders <<supply>> <<supply>> User Enquiry «process» Sell Books On-Line <<outcome>> Order <<uses>> <<input>> Cart Item Shopping Cart Warehouse Inv entory 0..n 1 «goal» Ship Order <<input>> Customer Order «process» Manage Customer Orders <<outcome>> Deliv ered Order <<supply>> Shipping Company Customer The business process model lets you model the main business activities. A 'Process' can cut across many departments or divisions of a larger entity. It describes something a business does as part of its normal activity; focussing mainly on the inputs, outputs, goals and key events that drive the process. UML also defines some additional stereotyped icons for use in business process modelling. The example below shows some of these. Note how these icons re-use the boundary, controller and entity icons from the Sequence diagrams. Geoffrey Sparks 2001 Page:7

Case Worker Class or Object element. Use stereotype to vary appearance. Internal Worker These are some additional business process extensions from the UML. They represent particular roles within the business process model. Worker State Charts Purpose State Charts are the third dynamic model that UML uses to capture system changes over time. Any object at run-time that has non-constant instance variables has some potential state. The actual state of an object depends on the values of its instance variables. Typically State charts are associated with particular classes (often a class may have one or more state charts to fully describe its potential states). In UML a State is displayed as a rounded rectangle with optional compartments for attributes, events and internal activities. State flows or transitions are drawn between States, usually with guard conditions and rules governing how and when an object may transition from one state to another. Careful use of State charts will help reveal the instance variables required to fully maintain the states of an object and the pre-conditions necessary to transition (update instance variables) to another state. States are usually named according to their condition for example Checking, Waiting and Dispatching are all active conditions an object can be in while waiting to transition to another state or end the cycle completely. Start and end nodes represented as solid and empty circles are used to represent the beginning and end of all transitions. Example Notation Geoffrey Sparks 2001 Page:8

Example State Chart from "UML Distilled" by Martin Fowler, p. 122 Start Checking + do/ check item getnextitem Dispatching + do/ InitiateDelivery [All items checkked && all items delivered] [All i tems checked and some i tem s not i n stock] Waiting Item Received Item Received Delivered Delivered Summary UML provides good support for dynamic modelling of software systems, from the early analysis (Activity diagrams and Business Process modelling) through to Use Case functionality (Sequence diagrams) and class behaviour (State charts). Each diagram type helps to capture information about the system as a whole and further refine the design and implementation details necessary to complete the software system. Geoffrey Sparks 2001 Page:9

Recommended Reading Sinan Si Alhir, UML in a NutShel. ISBN: 1-56592-448-7. Publisher: O'Reilly & Associates, Inc Doug Rosenberg with Kendall Scott,Dynamic Driven Object Modeling with UML. ISBN:0-201-43289-7. Publisher: Addison-Wesley Geri Scheider, Jason P. Winters, Applying Dynamics ISBN: 0-201-30981-5. Publisher: Addison-Wesley Ivar Jacobson, Martin Griss, Patrik Jonsson, Software Reuse ISBN:0-201-92476-5. Publisher: Addison-Wesley Hans-Erik Eriksson, Magnus Penker, Business Modeling with UML ISBN: 0-471-29551-5. Publisher: John Wiley & Son, Inc Peter Herzum, Oliver Sims, Business Component Factory ISBN: 0-471-32760-3 Publisher: John Wiley & Son, Inc Geoffrey Sparks 2001 Page:10