Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 UML and Modelling Behaviour. UML Unified Modelling Language Successor to a number of Object-Oriented Analysis and Design methods the 3 Amigos:

Similar presentations


Presentation on theme: "Lecture 5 UML and Modelling Behaviour. UML Unified Modelling Language Successor to a number of Object-Oriented Analysis and Design methods the 3 Amigos:"— Presentation transcript:

1 Lecture 5 UML and Modelling Behaviour

2 UML Unified Modelling Language Successor to a number of Object-Oriented Analysis and Design methods the 3 Amigos: Booch, Rumbaugh, Jacobson the company Rational markets Case tools (Rose), Development tools, courses and methods: RUP (Rational Unified Process) UML standardised by the OMG Very widely used

3 UML Diagrams Core Diagrams: –Class Diagram cf ER diagrams –State Diagram cf lifecyle diagrams Others have added to describe –Analysis ( Use case, Activity Diagram) –Interaction (Sequence Diagrams) –Delivery ( Package Diagram)

4 Real World Machine StaticDynamic Class Diagram Activity Diagram Use Case Diagram Sequence Diagram Collaboration Diagram State Diagram Package Diagram Deployment Diagram UML Diagrams Specification

5 Real World - Specification - Construction The development process requires models of different domains of the whole system real world –models of the real world - people, documents, activities, relationships specification –models of an ideal system - a specification independent of how the system will be construction constructed –models which explain how the constructed system works

6 General - Concrete General models describe the things that are true for a wide range of objects - for all objects of a given type or the common processing for a task Concrete models describe a specific collection of specific objects, or a specific sequence of events boat name,pos hoursTo() ‘perdika’ 15N 35W

7 Static - Dynamic Static: –Defines the structure of the software –Class (type) model - shows the classes, their attributes, methods and relationships –Package model - shows major subsystems Dynamic: –Defines the way the software behaves when it undertakes some activity, or responds to some event

8 User Interface Forms, Reports ‘Real World’ HTML, Windows Actors StakeholdersFlesh and Blood, Paper object DB layerOracle/SQLServer PL/SQL, J2EE,.NET Business Rules Middleware

9 Member Functions read –hoursTo(pos: Latlong) : Real update –moveTo(newpos: Latlong) : Latlong position := newpos; –to make this change persistant: select value(b) into cur from boats b where name=‘perdika’; cur.moveto(newpos); update boats b set row=cur where name=‘perdika’; object

10 Use Case : report boat position report boat position radio operator net controller

11 Use Case description During the role call each morning, the net controller will call each boat in turn. When the boat’s radio operator hears the name, she will reply and once connection has been established, the operator will report the boat’s current position and speed. The net controller records the new position.

12 Concrete Scenario The net controller on the morning of 18 May 2002 calls for ‘Perdika’. The skipper replies and reports the position as 23N 15E. The net controller enters this position but the system detects that this is too far from yesterdays position of 22N 14W. The net controller reports this error. ‘Perdika’ is not able to receive, but another operator reports that Perdika’s skipper doesn’t know his E from his W, and the net controller records 23N 15W which is accepted.

13 Sequence Diagram (concrete) calling ‘Perdika’ hello net position please 23N 15W radio op.net controller system move(Perdika,23N15W) ok thanks Perdika

14 Sequence Diagram calling hello net position please radio op.net controller system move(, ) ok thanks

15 Sequence Diagram - detailed calling hello net position please radio op.net controller GUI boats table move(, ) ok thanks a Boat moveTo( ) Server get boat( ) put boat( ) DB

16 Handling Errors Much of the complexity of a system lies in handling all the things which can go wrong with a basic use case: –RW problems: no reply from boat only part of the position heard position invalid w.r.t. previous position in database –Interface: controller enters name incorrectly –Machine problems - (failures) database out of date (bad restore) lost connection with server

17 Sequence Diagram (concrete) calling Perdika hello net position please 23N 15E radio op.net controller system move(perdika,23N,15E) error(out of range) are you sure? repeat 23N 15W move(perdika,23N,15W) ok thanks Perdika

18 Sequence Diagram - outofrange error calling roger position please radio op.net controller system move(, ) outofRange(pos,oldpos) error - repeat move(, ) ok

19 Generalised process Need to define a single process to handle –the normal error-free case boat name found, pos ok, –the normal errors boat name not found, pos ok, pos invalid, pos outofrange –the exceptional errors lost server connection, db error.. General case involves multiple sequences –choice - selection of paths –iteration - repeated paths –exceptions - quit main sequence

20 Activity Diagram Like a flow chart - describes an activity with multiple stages of processing Shows choice, iteration Allows parallel sub activities

21 Morning call process get name find name call name no more report pos input pos validate pos report/request update pos boat systemnet controller error

22 State Diagram Describes what happens to an object throughout its life cycle from creation to deletion. ‘Long Running Transaction’ Entity Life History

23 unknown pos new(name) safe at risk moveto() [no report for two days] moveto(pos) moveto() moveto(pos) drop

24 Work to do Tutorial - behaviour modelling –Mayday: boat reports trouble, net controller finds nearest boat and asks it to go to the aid of the boat in trouble –Emp-Dept: employee moves department manager approves salary increase for emp to top of salary grade Next week –Common tasks - matching –Patterns in design and analysis


Download ppt "Lecture 5 UML and Modelling Behaviour. UML Unified Modelling Language Successor to a number of Object-Oriented Analysis and Design methods the 3 Amigos:"

Similar presentations


Ads by Google