Executable UML The Models are the Code - Executable UML Lecture 8 - Interactions and Operations Paul Krause.

Slides:



Advertisements
Similar presentations
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Advertisements

Introduction to Software Engineering 7. Modeling Behaviour.
Object-Oriented Analysis and Design
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
CS3773 Software Engineering Lecture 03 UML Use Cases.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Systems Analysis and Design in a Changing World, Fourth Edition
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Collaboration Diagrams. Example Building Collaboration Diagrams.
Executable UML The Models are the Code - Executable UML Lecture 2 - Using Executable UML Paul Krause.
HAS. Patterns The use of patterns is essentially the reuse of well established good ideas. A pattern is a named well understood good solution to a common.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Academic Advisor: Dr. Yuval Elovici Professional Advisor: Yuri Granovsky Team: Yuri Manusov Yevgeny Fishman Boris Umansky.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 More on use cases System sequence.
Sept Ron McFadyen1 Extend Relationship.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
חוזים – Contracts 1. Larman – Chapter 10 – SSDs 10.2 What are System Sequence Diagrams? (introduction) Use cases describe how external actors interact.
An Introduction to Rational Rose Real-Time
Workflow Framework There are many open-source workflow frameworks available such as: –OS Workflow -
TK2023 Object-Oriented Software Engineering CHAPTER 6 SYSTEM SEQUENCE DIAGRAMS.
Process-oriented System Automation Executable Process Modeling & Process Automation.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Chapter 7: The Object-Oriented Approach to Requirements
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
USE Case Model.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
The Models are the Code - Executable UML
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
State Diagrams / System Sequence Diagrams (SSDs)
Executable UML The Models are the Code - Executable UML Lecture 9 - Communication and Relationship Dynamics Paul Krause.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
More with Methods (parameters, reference vs. value, array processing) Corresponds with Chapters 5 and 6.
System Specification Specify system goals Develop scenarios Define functionalities Describe interface between the agent system and the environment.
Requirement Engineering. Review of Last Lecture Problems with requirement Requirement Engineering –Inception (Set of Questions) –Elicitation (Collaborative.
Dynamic Modeling Chapter 11 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 4, Requirements Elicitation.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Systems Analysis and Design in a Changing World, 3rd Edition
UML-1 3. Capturing Requirements and Use Case Model.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
TAL7011 – Lecture 4 UML for Architecture Modeling.
Conceptual Model or Domain Models Chapter10 Applying UML and pattern.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
 System Sequence Diagrams Sheridan SYST Engineering Quality Systems 11.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
SYSTEM-LEVEL SEQUENCE DIAGRAMS Sys466. System-Level Sequence Diagrams  Use cases describe how external actors interact with the software system…  An.
1 Object Oriented Analysis and Design System Events & Contracts.
Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.
1 Advanced DataBases Unified Modelling Language An Introduction and Use Case Lecture 2 Susan Curtis.
CompSci 280 S Introduction to Software Development
Systems Analysis and Design in a Changing World, Fourth Edition
Systems Analysis and Design in a Changing World, 6th Edition
System Sequence Diagrams and Operation Contracts
Webapp Design with System Sequence Diagrams
Sequence Diagram.
Prepared By Sidra Noureen
UML dynamic Modeling (Behavior Diagram)
Systems Analysis and Design in a Changing World, 6th Edition
Use Cases Based on the paper
Presentation transcript:

Executable UML The Models are the Code - Executable UML Lecture 8 - Interactions and Operations Paul Krause

Executable UML Lecture 8 - Interactions and Operations v Domain-level sequence diagrams v Object-level sequence diagrams v Collaboration diagrams v Operations and the Action Specification Language

Executable UML Use Case Description Use Case Name Purpose Preconditions Invariants Primary Scenario Postconditions Make Fuel Delivery To allow a paying customer to deliver fuel of a selected grade The desired fuel grade is available Tank level >4% tank capacity while pump is on 1. Customer removes nozzle from holster; 2. Attendant enables pump; 3. Customer selects one fuel grade; 4. Pump motor is started; 5. Customer uses trigger to control fuel delivery; 6. Customer replaces nozzle in holster; 7. Pump motor is stopped. At least 2 litres of fuel have been delivered

Executable UML Domain Level Sequence Diagram Forecourt Hardware InterfacingUser InterfaceFuel SalesCheckout 1: binaryInputChanges 2: nozzleRemoved 3:requestPumpEnable 4:alertAttendantToRequestForPumpEnable 5:pumpEnableButtonPressed 6:pumpEnabled 7:GO creation 8:enablePump 9:setBinaryOutput 10:binaryInputChanges 11:triggerDepressed 12:startPumping 13:impellorPulse 14:fuelUnitDelivered 1: Customer removes nozzle 2: 3:Request pump enable 4: Alert attendant of Customer 5: Attendant enables pump 6: 7: Create Transaction Item 8: 9: Pump motor enabled 10: Customer presses trigger 11: 12: Start pumping fuel 13: loop until trigger released 14: Unit of fuel is delivered 15: …

Executable UML Object Level Sequence Diagram: > Administrator selectedPatient: Patient availableBed: Bed > Resource Allocation > Location Tracking admitPatient assignBed bedAssigned patientNowInBed requestCaseNotes patientAdmitted Admit In-Patient

Executable UML Object collaboration diagram: Admit Patient > Administrator selectedPatient: Patient availableBed: Bed > Resource Allocation > Location Tracking Admit In-Patient

Executable UML Object collaboration diagram > Administrator selectedPatient: Patient availableBed: Bed > Resource Allocation > Location Tracking 1: admitPatient5: requestCaseNotes 2: assignBed 3: bedAssigned 4: patientNowInBed 6: patientAdmitted Admit In-Patient

Executable UML Object collaboration diagram > Administrator selectedPatient: Patient availableBed: Bed > Resource Allocation > Location Tracking 1: dischargePatient4: returnCaseNotes 2: releaseBed3: bedReleased5: patientDischarged Discharge In-Patient

Executable UML Class collaboration diagram > Administrator :Patient :Bed > Resource Allocation > Location Tracking dischargePatientreturnCaseNotes releaseBedbedReleasedpatientDischarged admitPatient requestCaseNotes assignBed bedAssigned patientNowInBed patientAdmitted

Executable UML Simple Train Example [Raistrick et al, 2004] Hop 1Hop 2 Acceleration Curve 1 Acceleration Curve 2 Acceleration Curve 3 Acceleration Curve 4 Acceleration Curve 5 Acceleration Curve 6 Speed Distance

Executable UML Train Control Domain TrainHopAccelerationCurveJourney is established by has firstis first hop in is currently being negotiated by is currently negotiating is preceded by is followed by is first curve in has firstis currently performing is currently being performed by is followed by is preceded by has established R1 R2 R3 R4 R5 R6 R7

Executable UML Class collaboration model :Train :Hop:AccelerationCurve > :Motor negotiateHopperformCurve adjustSpeed hopNegotiatedcurvePerformed finalHopNegotiatedfinalCurvePerformed

Executable UML Assigning class responsibilities :Train :Hop:AccelerationCurve > :Motor negotiateHopperformCurve adjustSpeed hopNegotiatedcurvePerformed finalHopNegotiatedfinalCurvePerformed At start of jounrey: 1. link myself to first hop 2. ask hop to “negotiate” itself When each hop is complete: 1.Unlink that Hop from Train 2.Delete the completed Hop 3.Link next Hop (if any) to train When each AccelerationCurve (AC) is complete: 1.Unlink that AC from Hop 2.Delete the completed AC 3.Link the next AC (if any) to Hop

Executable UML Policies for the Train Control Domain v Dynamic classes are created “top-down” v Deletion is performed “bottom-up” v Commands are sent “top-down” v Responses are sent “bottom-up” v Unfortunately, it is not always possible to have such simple policies!

Executable UML Modelling Operations v Operations are used to model state-independent behaviour v An operation is the invocation of some action via a parameterised interface  think of a method call in Java or a function call in C v Operations are executed synchronously  the caller waits until the action has been executed and a result returned before continuing v The resulting action may in turn invoke (synchronously) other actions, or asynchronous behaviour by generating signals

Executable UML Generic operation rules v Operations are specified with an Action Specification Language (ASL) v Operations:  are executed synchronously  may have zero or more input parameters  may have zero or more output parameters  may have input and output parameters of any valid data type

Executable UML Types of operation v Object-based  defined in a class v Class-based  may be underlined in a class definition v Domain-based  associated with the domain as a whole v Bridge  used to map the service requirements to the service requirements of one or more other domains

Executable UML Domain operations Fuel SalesShopping Forecourt Hardware Interfacing Checkout User InterfaceLogging Telecommunications Interface A domain based operation can be invoked by: any class in its domain any bridge operation

Executable UML Class and object operations PumpPumpSpecificationFillingStation Nozzle TankFuelGrade A class or object based operation can be invoked by: any class or class instance in its domain any domain based operation associated with its domain any bridge operation if it is declared to be “externally visible”

Executable UML Example object operation AccelerationCurve curveID startDistance endDistance desiredStartSpeed desiredEndSpeed pollingTimerID pollingRate pollingRateUnits nextCurveID createAccelerationCurve calculateDesiredSpeed if (distanceAlongHop = thisStartDistance) & \ (this.startSpeed = 0.0) then theTrain = this -> R3 -> R2 desiredSpeed = theTrain.minimumSpeed else lengthOfCurve = this.endDist - this.startDist requiredSpeedDiff = this.endSpeed - this.startSpeed speedGradient = requiredSpeedDiff / lengthOfCurve distanceAlongCurve = distAlongHop - this.startDist deltaSpeed = distanceAlongCurve * speedGradient desiredSpeed = deltaSpeed + this.startSpeed end if calculateDesiredSpeed(distanceAlongHop:Real = 0.0):(desiredSpeed:Real)

Executable UML Invoking an object-based operation [theDesiredSpeed] = AC2:calculateDesiredSpeed[hopDistance] on theAccCurve Return parameter(s) Key letter for AccelerationCurve Class Operation number in the class definition class instance handle keyword “on” indicates this operation is object based

Executable UML Is ASL another programming language? v ASL does not specify software structure anywhere:  no pointers, arrays, lists … v No mechanisms to show  persistence  manner of invocation  manner of distribution of messages  how data is stored v All these are the business of the model compilers as they are platform dependent issues

Executable UML Summary v Behaviour of active objects is specified with state charts v Signals or events induce transitions in an object’s lifecycle v State-independent behaviour is captured in operations v Sequence and collaboration diagrams summarise the signal events and operation calls between objects as they work together to achieve some goal