Brief Introduction to UML 2.0 (for SEG seminar)

Tian Zhang Nanjing University,China October 2005 2

Tian Zhang @ Nanjing University Background Process of UML 2.0 adoption Overview of UML 2.0 Superstructure ‰ ‰ ‰ Part I : Part II: Outline „ „ 3

Tian Zhang @ Nanjing University OMG's technology adoption process UML 1.4, 1.5, 2.0 UML 2.0 in MDA The current status of UML 2.0 Part I „ „ „ „ 4 的四部分提案需求 的修订信息需求

Tian Zhang @ Nanjing University Superstructure 的最终正式版 26 个响应者大多数提议进行重大修订 年提出 UML 年初发布 UML2.0 在 1999 于 2000 OMG 来自不同领域的 OMG 今年 10 月通过了 其余部分仍处于最终修改版阶段 Optional RFI stage TF issues RFP, evaluates submissions Voting to Adopt an OMG specification Finalization - getting ready for prime time The OMG specification maintenance Cycle Retiring Obsolete Specifications ‰ ‰ ‰ ‰ ‰ OMG's Technology Adoption Process 1. 2. 3. 4. 5. 6. 5 OCL Interchange to specify Tian Zhang @ Nanjing University to specify UML systems (e.g., class r specific domains Superstructure Infrastructure user-level constructs and to customize it fo (e.g., real-time) Defines Defines basic constructs Defines structure and behavior of , sequence diagrams) UML 2.0 RFPs 6 在体系 ; CWM 、 CWM 和 设计目标 基础结构库 (Infra- 元模型之外,还可以 MOF – 和 通过对此核心的复用,除了

Tian Zhang @ Nanjing University 定义一个元语言的核心 可以定义一个自展的 UML 通过共用核心包, UML structureLibrary) 定义其他元模型,包括 MOF 结构上保持一致。 UML 2.0 Infrastructure „ „ 7 that , MSCs and furnish apply and able to behavioral of parallelism generalizable development integration and to make of parts with interfaces (compare SDL with other behavior uage to make it easier with advanced constructs from view to support more flexible precision integrated , Tian Zhang @ Nanjing University models -based and customize scalability transition-centric sequence diagrams and hierarchical composition executable state machines diagrams combined diagrams I/O options more specify both platform-independent components (e.g., business components) and platform-specific components (e.g., EJB, COM+) support augment update revise support blocks and processes) can be support a ‰ ‰ ‰ ‰ ‰ ‰ implement diagrams Restructure and refine the lang Improve support for Refine architectural specification capabilities Increase the Review all UML 1.x constructs and diagrams Goals of UML 2.0 Superstructure „ „ „ „ „ 8 等),提高对基于 设计目标 COM+ 中的模型构造物; , EJB

Tian Zhang @ Nanjing University Infrastructure MDA 的支持; UML1.x 的构造物和图,适当地精化、取缔 和逐步淘汰。 严格地复用 既可以描述平台无关构件(如业务构件),也可以描 述平台相关构件(如 支持接口、部件和连接子,及其层次化组合能力,从 而提高对架构的规约能力; 增强行为图的可伸缩性、精确性和集成能力; 支持可执行模型; 审定所有 构件开发和 UML 2.0 Superstructure „ „ „ „ „ „ 9 Pages Statistic ptc/05-06-04 Infrastructure : 226 pages Superstructure : 709 pages Diagram Interchange : 82 pages OCL : 185 pages formal/05-07-04 ptc/04-10-14

Tian Zhang @ Nanjing University ptc/05-06-06 is complete - stable since it took its adopted form in October, 2004. ‰ UML 2.0 Superstructure UML 2.0 Infrastructure UML 2.0 Diagram Interchange UML 2.0 OCL UML 2.0, The Current Official Version: „ „ „ „ 10 的核心规范: MOF current version 1.4 UML current version 1.5 CWM current version 1.0 XMI current version 2.1 • • • • Meta Object Facility Unified Modeling Language Common Warehouse Metamodel XML Metadata Interchange MDA • • • •

Tian Zhang @ Nanjing University UML 2.0 in MDA 11 , to August 26, 2004 : ORMSC plenary session ORMSC

Tian Zhang @ Nanjing University enable the metadata to be understood in a standard manner, which is a precondition for any ability to perform automated transformations. Any modeling language used in MDA must be described in terms of the MOF language The following was approved unanimously by 17 participants at the The Role of UML & MOF in MDA „ 12

Tian Zhang @ Nanjing University UML 2.0 Superstructure Specification Thirteen diagrams in UML 2.0 Part II „ „ 13 formal/03-03-01 UML 1.5 Part 1 - Background Part 2 - Foundation Part 3 - Behavioral Elements Part 4 - General Mechanisms Part 5 - Actions Part 1 - Background Part 2 - Elements Diagram Part 3 – Management Model Part 4 - General Extension Mechanisms 5 -Part Diagrams Structure Static Part 6 - Case Diagrams Use Part 7 - Interaction Diagrams Part 8 - Collaboration Diagrams 9 -Part Statechart Diagrams Part 10 - Activity Diagrams UML Model Interchange UML Notation Guide UML Semantics UML Summary . UML Example Profiles ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ 1. 2. 3. 4 5. „ „ „ „ „

Tian Zhang @ Nanjing University Classes Components Composite Structures Deployments Actions Activities Common Behaviors Interactions State Machines Use Cases Auxiliary Constructs Profiles A - Diagrams B - Keywords UML C - Stereotypes Standard ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Part I: Structure Part II: Behavior Supplement Part III: Part IV – Annexes UML 2.0 Superstructure „ „ „ „ 14

Tian Zhang @ Nanjing University . easy to learn and use easy to define compliance levels ‰ ‰ The modeling concepts of UML are grouped into language units For example, the State Machines language unit enables modelers to specify discrete -driven behavior using a variant of the well-known statecharts formalism. Two benefits : Language Units „ „ „ 15

Tian Zhang @ Nanjing University This level is formally defined in the It adds language units for use cases, It adds language units for This level represents the complete - - - UML. Level 0 (L0) - Level 1 (L1) Level 2 (L2) Level 3 (L3) UML Infrastructure. interactions, structures, actions, and activities. deployment, state machine modeling, and profiles. Compliance Levels „ „ „ „ 16 种图 ) ; 9 Interaction Overview Diagram State Machine Diagram Timing Diagram Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ 将结构元素和行为元素结合 (UML 1.x 支持

Tian Zhang @ Nanjing University UML 2.0 种图 13 支持 Composite Structure Diagram ‰ ‰ ‰ ‰ ‰ ‰ 起来建模的能力大大增强; 与 UML1.x 相比, UML 2.0 Diagrams in UML 2.0 „ „ 17

Tian Zhang @ Nanjing University 18 改名为通讯图 改名为状态机图 1.x 中状态图和状态 ,但语义并没有丰富到与 ,解决了

Tian Zhang @ Nanjing University (Collaboration Diagrams) (Statechart Diagrams) 原来的协作图 (Communication Diagrams) 原来的状态图 (State Machine Diagrams) 机的语义重叠、模糊不清的问题。 顺序图等价的地步; ‰ ‰ Add four diagrams; Renamed two diagrams: „ „ Changes from 1.x 19

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 20 .

Tian Zhang @ Nanjing University internal structure Part Connector Port ‰ ‰ ‰ One of the most significant new features in UML 2 is the ability to hierarchically decompose a class into an This allows you to take a complex object and break it down into parts The core constructs of Composite Structures are: Composite Structure Diagram „ „ „ 21

Tian Zhang @ Nanjing University TV (1) Two ways of showing a TV viewer and its interfaces Fig. 1. Example 1 – 22 内部结构表示出一个类 如何在内部分解成两部 分以及哪些部分支持并 需要哪些不同接口。 该图说明了每一个 TV 观众包含一个控制部分 和一个发生器部分。 Internal view of a „ „ component (example suggested by Jim Rumbaugh) Fig. 2.

Tian Zhang @ Nanjing University TV (2) Example 1 – 23 A component with required and provided interfaces that a component has with the that multiple ports Fig. 3. (3)

Tian Zhang @ Nanjing University TV – ports allow you to group the to show logical interactions outside world ‰ ‰ You can add ports to the external structure Example 1 „ 24 ).

Tian Zhang @ Nanjing University Martin Flower packages are a compile-time grouping composite structures show runtime groupings ‰ ‰ Compare with Packages Natural fit for showing components and how they are broken into parts Much of this notation is used in component diagrams ( When to Use Composite Structures „ „ „ 25

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 26

Tian Zhang @ Nanjing University is a grouping construct that allows you to System::Date Subsystem::Util::Date ‰ ‰ take any construct in the UML and group its elements together into higher-level units A Each package represents a namespace Use double colons to show package names in UML Package Diagrams „ „ „ 27

Tian Zhang @ Nanjing University Package diagram for an enterprise application Fig. 4. Packages and Dependencies 28

Tian Zhang @ Nanjing University A package implemented by other packages Fig. 5. It's quite common for an interface and its implementation to be in separate packages Implementing Packages „ 29 This is an example of the pattern Separated Interface .

Tian Zhang @ Nanjing University Defining a required interface in client package Fig. 6. Implementing Packages 30

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 31 ) Table of Contents Actions Activities Common Behaviors Interactions State Machines Use Cases (cite in 11. 12. 13. 14. 15. 16. Part II: Behavior

Tian Zhang @ Nanjing University Behavior Diagrams 32 structure packages they

Tian Zhang @ Nanjing University The UML packages that support behavioral The UML packages that modeling, along with the depend upon (CompositeStructures Classes) and are shown in the figure above. „ 33

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 34 . work flow flowcharts , and parallel behavior

Tian Zhang @ Nanjing University , business process the principal difference between them and flowchart notation is that they support ‰ Activity diagrams are a technique to describe procedural logic Activity diagrams play a role similar to Activity diagrams have seen some of the biggest changes over the versions of UML, so they have, not surprisingly, been significantly extended and altered again for UML 2 Activity Diagrams „ „ „ 35 ssifiers responsible for those

Tian Zhang @ Nanjing University behaviors. Secondary constructs show cla Secondary constructs Nodes: Action, Object, Control, Parameter Edges: Control and Object Flows Computational Business Physical Systems Requirements ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Activities are behaviors that emphasize the sequence and conditions for executing other behaviors. The core constructs in an Activity include: Typical applications of Activities are process modeling in a wide variety of domains: Activity Modeling „ „ „ 36 (procedure), Actions define the ons is replaced with the more es is replaced with the more structured nodes, replace

Tian Zhang @ Nanjing University Procedure replaced with Activity. InvocationNode replaced with Action. ‰ ‰ general flow model of activities. IterationGroups. Eliminate overlapping semantics, create synergy. Data/control flow model of acti Behavior invocation of Activiti Composite actions become Map/FilterAction replaced with ExpansionRegion, IteractionAction with LoopNode, ReduceAction removed. Activities define the flow graph general action model. nodes that perform behaviors. Collect ion actions folded into flow model. Action/Activity Integration „ „ „ „ „ „ 37 Amount Set Send Notice Balance +

Tian Zhang @ Nanjing University Get Balance Get Customer update_account Action/Activity Example Account Deposit 38 Package Part Polish Part

Tian Zhang @ Nanjing University {stream} can Part Machine stack up in “in/out” boxes backup in network prevent upstream behaviors from taking new inputs ‰ ‰ ‰ Queuing: Tokens Applicable to systems with significant resource constraints, such as physical or manual processes. „ „ „ Change Highlights 39 Z Z Y C Y C X B X B Tian Zhang @ Nanjing University Trace: A, B||X, C||Y, Z A A Parallelism in UML1 activities: „ Change Highlights 40 Z Z Y C C Y || (X,Y) B X

Tian Zhang @ Nanjing University X B A Trace: A, (B,C) , Z A Parallelism in UML2 activities: „ Change Highlights 41 Z Y C X B N || (X,Y) || N

Tian Zhang @ Nanjing University A Trace: A, (B,C) , Z Unrestricted flow patterns in UML2 activities: „ Change Highlights 42

Tian Zhang @ Nanjing University Actions can be decomposed into subactivities „ Decomposing an Action 43

Tian Zhang @ Nanjing University 44

Tian Zhang @ Nanjing University grid two- If you want to show who does what, you can divide an activity diagram into partitions In UML 2, you can use a dimensional Partitions „ „ 45

Tian Zhang @ Nanjing University occurs because of the passage time time signal Actions can also respond to signals A A signal indicates that the activity receives an event from an outside process As well as accepting signals, we can send them Signals „ „ „ „ 46

Tian Zhang @ Nanjing University signal (1) – Example 47

Tian Zhang @ Nanjing University signal (2) – Example 48

Tian Zhang @ Nanjing University The initial creates a token, which then passes to the next action, which executes and then passes the token to next At a fork, one token comes in, and the fork produces a token on each of its outward flows on a join, as each inbound token arrives, nothing happens until all the tokens appear at join then a token is produced on the outward flow Tokens „ „ „ „ 49

Tian Zhang @ Nanjing University Four ways of showing an edge Fig. The simplest kind of edge is the simple arrow between two actions ‰ UML 2 uses the terms flow and edge synonymously to describe the connections between two actions Flows and Edges „ 50 marks an activity diagram area

Tian Zhang @ Nanjing University where actions occur once for each item in a collection An expansion region Expansion Regions „ 51

Tian Zhang @ Nanjing University Pins (input/output, alternative sets) Pins (input/output, Groupings (structured nodes, interruptible regions) Edges (token flow) Object nodes (queuing, signals, parameters) Parameters (streaming, exceptions) Partitions (multidimensional, hierarchical, external) Control nodes (fork, join, decision, merge) Activities (attributes, operations, etc.) ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Integration of actions and activities New core constructs added: UML 1.4 core constructs updated: „ „ „ Change Summary 52

Tian Zhang @ Nanjing University The great strength of activity diagrams lies in the fact that they support and encourage parallel behavior You can also use an activity diagram as a UML- compliant flowchart In principle, you can take advantages of the forks and joins to describe parallel algorithms for concurrent programs It’s dangerous to use activity diagrams describing cases, better off with the usual textual form When to Use Activity Diagrams „ „ „ „ 53

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 54 ,可以通过实例的 和交互操作符等,以表示选择、循 (Decomposition)

Tian Zhang @ Nanjing University ) 的分解能力 (Interaction occurrence) ,允许从一个交互引用到另一个 (Combined fragment) ( Lifeline 内部结构来细化交互过程。 交互发生 交互,避免了交互的复制; 组合片断 对生命线 环、并行、有序、引用等复杂的控制结构; ‰ ‰ ‰ 新的顺序图在描述复杂交互的伸缩能力方面有了显著提 高,新增了: Variations in Sequence Diagrams „ 55 ): M. Flower or indeed with code itself

Tian Zhang @ Nanjing University these aren't what sequence diagrams are good at to show control structures, better off with an activity diagram ‰ ‰ These are new features in UML 2.0 The first thing to point out is that ( Loops, Conditionals, and the Like „ „ 56 Interaction frames

Tian Zhang @ Nanjing University Fig. 7. 57 guards and

Tian Zhang @ Nanjing University iteration markers An iteration marker is a * added to the message name. You can add some text in square brackets to indicate the basis of the iteration. Guards are a conditional expression placed in square brackets and indicate that the message is sent only if guard is true. While these notations have been dropped from sequence diagrams in UML 2, they are still legal on communication diagrams. ‰ ‰ ‰ UML 1.x used Older Conventions in UML 1.x „ 58 is to . ACSystem Part decomposition UserAccess ACSystem we see how within be ecomposed to AC_UserAccess , which is an Interaction owned by class

Tian Zhang @ Nanjing University Fig. 8. Part Decomposition (example in Specification) 59 :Controller ValidateCoin() create :Detector Decomposition Insert(coin) sd RejectCoin()

Tian Zhang @ Nanjing University :VendingMachine :VendingMachine ref Decomposition Insert(coin) RejectCoin() :User Overview sd To hide information, a lifeline can be subdivided into more detailed sequences „ Part Decomposition 60 :VendingMachine ValidateCoin ChooseProduct Display(price) :User ref ref sd BuyScenario

Tian Zhang @ Nanjing University a way to quickly create new scenarios (e.g., tests and test suites) ‰ To avoid unnecessary duplication, it is possible to refer already existing sequence diagrams „ Referencing Sequences 61 [else] DispenseProduct ValidateCoin Initiate ref ref ref [price=0] Overview Overview sd

Tian Zhang @ Nanjing University Interaction Overview diagram = interaction diagram + activity combine interactions in different ways to create new scenarios ‰ ‰ It is possible to organize sequence diagrams into flows to indicate how they fit together „ Organizing Sequences 62 only if the supplied condition is Meaning

Tian Zhang @ Nanjing University Tab. 1. Common Operators for Interaction Frames true. Equivalent to an alt with only one trace. Alternative multiple fragments; only the one whose condition is true will execute. Optional; the fragment executes Parallel; each fragment is run in parallel. Loop; the fragment may execute multiple times, and guard indicates the basis of iteration. Critical region; the fragment can have only one thread executing it at once. Negative; the fragment shows an invalid interaction. Reference; refers to an interaction defined on another diagram. The frame is drawn to cover the lifelines involved in interaction. You can define parameters and a return value. Sequence diagram; used to surround an entire sequence diagram, if you wish. Operator alt opt par loop region neg ref sd 63

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 64 tivities are replaced by little

Tian Zhang @ Nanjing University activity diagrams in which the ac or, a sequence diagram broken up with activity notation used to show control flow. sequence diagrams ‰ ‰ Interaction overview diagrams are a grafting together of activity diagrams and sequence You can think of interaction overview diagrams as: Interaction Overview Diagrams „ „ 65 : Martin Fowler “I'm not keen on them, as I think that they mix two styles that don't really mix that well. ”

Tian Zhang @ Nanjing University Interaction summary diagram Fig. 9. 66 :ServiceBase SetHome FindLocation :ServiceBase :ServiceUser sd ref SetInvocationTime SetTransportPreferences Tian Zhang @ Nanjing University Authorization :ServiceUser sd ref sd GoHomeSetup diagram Interaction Overview Diagram Interaction with the Expanded sequence Interaction Occurrence syntax of Activity Diagram 67 do not appear at Messages

Tian Zhang @ Nanjing University flow of control and the 片断内部不能出现 Lifelines overview level 从概观的层次上不能有生命线和消息,但并不意味着在交互 (Interaction) An Interaction diagram of any kind may appear inline as an ActivityInvocation ‰ ‰ this Interaction Overview Diagrams focus on the overview of the The Note That „ „ 68

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 69 order of sending a given set of the internal structure and how spond to simple Sequence s on the interaction between

Tian Zhang @ Nanjing University Lifelines where the architecture this corresponds with the message passing is central. Diagrams that use none of the structuring mechanisms such as InteractionUses and CombinedFragments. messages) will not take place or is irrelevant. Communication Diagrams focu Communication Diagrams corre It is also assumed that message overtaking (i.e., the order of receptions are different from the ‰ ‰ ‰ Definition in Specification 通信图着重体现的是交互者之间的交互关系 Communication Diagrams „ „ 70

Tian Zhang @ Nanjing University messages m1 and m3 being sent concurrently from :r towards two instances of the part s sequence numbers show how the other messages are sequenced „ „ 71

Tian Zhang @ Nanjing University , a strong part of the decision is sequence diagrams are better when you want to emphasize the sequence of calls communication diagrams are better when you want to emphasize the links however personal preference When to Use Communication Diagrams „ „ „ 72

Tian Zhang @ Nanjing University Class Diagram Composite Structure Diagram Component Diagram Deployment diagram Object Diagram Package Diagram Activity Diagram Use Case Diagram State Machine Diagram Communication Diagram Sequence Diagram Interaction Overview Diagram Timing Diagram ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ ‰ Structure Diagram Behavior Diagram Thirteen diagrams in UML 2.0 „ „ 73

Tian Zhang @ Nanjing University Used to show interactions when a primary purpose of the diagram is to reason about time. Focus on conditions changing within and among Lifelines along a linear time axis. Timing Diagram „ „ 74 time constraint ruler timing OK {t..t+3} OK t CardOut stimulus event or {d..3*d} 2 Duration constraint Code 1 0

Tian Zhang @ Nanjing University Idle WaitCard WaitAccess UserAcc_User

values :User tick mark sd State or condition A Lifeline for a discrete object Lifeline 75 Occurrence- along a Lifeline is may have multiplicity greater ithin an Interaction) is the

Tian Zhang @ Nanjing University StructuralFeatures of this Lifeline. OccurrenceSpecifications and Parts than 1, Lifelines represent only one interacting entity. significant denoting the order in which they will occur. A lifeline represents an individual participant in the Interaction. While The order of The semantics of the Lifeline (w semantics of the Interaction selecting only semantics of Specifications ‰ ‰ ‰ ‰ Description Semantics Lifelines are basically the same concept as before in UML 1.x. Lifeline (from BasicInteractions, Fragments) „ „ „ 76 and the Inter- Message Occurrence- fication is just the trace of es specified by them are . e ordered along a Lifeline.

Tian Zhang @ Nanjing University is dependent upon the associated . The sequences of occurrenc An OccurrenceSpecification is the basic semantic unit of OccurrenceSpecifications ar The semantics of an OccurrenceSpeci The understanding and deeper meaning of the actions single OccurrenceSpecification. that Specification the meanings of Interactions information that it conveys. ‰ ‰ ‰ ‰ Description Semantics OccurrenceSpecification „ „ 77 Duration constraint

Tian Zhang @ Nanjing University State or condition Lifeline Sometimes it is more economical and compact to show the state or condition on vertical Lifeline Compact Lifeline with States „ 78 Message Time Constraint Time Observation Duration Constraints Duration

Tian Zhang @ Nanjing University Timing Diagram with more than one Lifeline and with Messages Lifelines State or condition Duration Observation 79 or attribute, of time. Value is of time. text. Crossing reflects ndition, such as an ndition, e to let the state- e to let the value changed. Reference ”page lifeline discrete enumerable value. discrete enumerable the event where This is the state of or some testable co It is also permissibl as well discrete. be continuous dimension Shows the value of connectable as a function element denoted as explicitly see “

Tian Zhang @ Nanjing University Notation Node Type Graphic nodes and paths included in timing diagrams State or condition timeline General value lifeline Lifeline 80 at least 10 seconds must pass between the pump coming on and the hotplate when the water reservoir becomes empty, the pump switches off, and hotplate cannot stay on for more than 15 minutes more

Tian Zhang @ Nanjing University ‰ ‰ Rules of time : „ 向壶中注水 给咖啡壶加热 Pump Hotplate – – Simple scenario - coffee pot 81

Tian Zhang @ Nanjing University Timing diagram showing states as lines Fig. State or condition timeline 以水平中轴为基准,将两个对象的时间图放到一起。这种复合的方式 可以扩展到多个,但时间轴需要统一。 „ „ 82 element as a function of time. t. Crossing reflects the event where

Tian Zhang @ Nanjing University Timing diagram showing states as areas Fig. Value is explicitly denoted as tex the value changed. Shows the value of connectable „ 83 . See can be found communityUML the , 2U Consortium www.uml.org

Tian Zhang @ Nanjing University www.cs.york.ac.uk/puml/uml2_0.html www.uml-forum.com www.2uworks.org UML home page, at UML Forum, at The leading group, called U2P (UML 2.0 Partners), at www.u2-partners.org One of the proposing groups http://community-ml.org/submissions.htm A specific Web site for the A specific Web site for the precise UML group (pUML) can be found at at Useful UML Web Sites „ „ „ „ „ „ 84

Tian Zhang @ Nanjing University Thanks 85 工作组

Tian Zhang @ Nanjing University 提案需求 修订信息需求 对象和参考模型小组委员会 UML 2.0 RFI: UML 2.0 RFP: UML 2.0 Task Force: Object and Reference Model Subcommittee (ORMSC): Appendix 1 „ „ „ „ 86

Tian Zhang @ Nanjing University optional RFI stage TF issues RFP, evaluates submissions voting to Adopt an OMG specification finalization - getting ready for prime time the OMG specification maintenance Cycle retiring Obsolete Specifications OMG's Technology Adoption Process 1. 2. 3. 4. 5. 6. Appendix 2 „ 87

Tian Zhang @ Nanjing University Patterns of Enterprise Application Architecture Refactoring: Improving the Design of Existing Code UML Distilled: A Brief Guide to the Standard Object Modeling Language Planning Extreme Programming Analysis Patterns: Reusable Object Models Martin Flower „ „ „ „ „ 88

Tian Zhang @ Nanjing University Actions Activities Interactions State Machines Use Cases Concepts in UML 2.0 Behavior Part „ „ „ „ „ 89 of behavior specification providing inputs to actions from

Tian Zhang @ Nanjing University fundamental unit the outputs of other actions either or both sets may be empty either or both sets the activity flow model supports ‰ ‰ An action is the An action takes a set of inputs and converts them into set of outputs Some of the actions modify state system in which the action executes Actions „ „ „ 90 , operation calls behavior invocation

Tian Zhang @ Nanjing University are defined so that they either carry out include those that perform , and direct a computation or access object memory, but never both Basic actions primitive actions signal sends Actions (2) „ „ 91 of a composite in MSC there are See also Referring he structure is reflected in ynchronous and synchronizing is a part of structure MSC and UML have different hand for the par-operator. No message gates, while another interaction. Interaction fragment structure, while the instance also general ordering gates. Comments The individual scenarios. Notice that a lifeline refers to property (part) Both distinguish between as messages In UML we have only See In MSC this is a basic concept fr om 1992, but in UML 2.0 only presented as a short How the aggregate hierarchy of t interactions/MSCs. The ability to refer another interaction / MSC diagram approaches to language. semantic difference

Tian Zhang @ Nanjing University UML 2.0 Interaction diagrams EventOccurrence Lifeline Message Operation call ExecutionOccurrence Gate Interaction fragment Coregion PartDecomposition Interaction Occurrence MSC-2000 MSC (Message Sequence Chart) Event Instance Message Method call Action Gate No direct counterpart Coregion Decomposition MSC reference