Brief Introduction to UML 2.0 II1 -State Machine Modeling in UML2.0 (for SEG seminar) Tian Zhang Nanjing University,China November 2005 成
Brief Introduction to UML 2.0 III – State Machine Modeling in UML2.0 (for SEG seminar) Tian Zhang Nanjing University,China November 2005
Appendix I一关于并发和并行 a并行性(parallelism)有三种含义: 同时性(simultaneity):指两个或多个事件在同一时刻发生在 多个资源上: 口并发性(concurrency):指两个或多个事件在同一时间间隔发 生在多个资源上: 流水线(pipeline):指两个或多个事件发生在可能重叠的时间 段内。 Tian Zhang Nanjing University 2
Tian Zhang @ Nanjing University 2 Appendix I — 关于并发和并行 并行性(parallelism)有三种含义: 同时性(simultaneity):指两个或多个事件在同一时刻发生在 多个资源上; 并发性(concurrency):指两个或多个事件在同一时间间隔发 生在多个资源上; 流水线(pipeline):指两个或多个事件发生在可能重叠的时间 段内
Outline Overview A review of statecharts 口 conventional state machine modeling two main limitations Harel Statecharts 口 original Harel Statecharts object-based variant of Harel Statecharts ■ State Machines in UML2.0 口 concepts and constructs diagrams Tian Zhang Nanjing University 3
Tian Zhang @ Nanjing University 3 Outline Overview A review of statecharts conventional state machine modeling – two main limitations Harel Statecharts original Harel Statecharts object-based variant of Harel Statecharts State Machines in UML2.0 concepts and constructs diagrams
Overview State Charts/Machines in both UML1.5 and 2.0 are kinds of object-based variant of Hare/statecharts. State Machines are essentially finite state-transition system used for modeling discrete behavior. ■ In addition to expressing the behavior of a part of the system,state machines can also be used to express the usage protocol of part of a system. 总之,UML2.0中的状态机是传统状态机的一个发展,它支持 OO、层次化、并发性、通信等,以实现对现代复杂分布式系 统的建模。 Tian Zhang Nanjing University 4
Tian Zhang @ Nanjing University 4 Overview State Charts/Machines in both UML1.5 and 2.0 are kinds of object-based variant of Harel statecharts. State Machines are essentially finite state-transition system used for modeling discrete behavior. In addition to expressing the behavior of a part of the system, state machines can also be used to express the usage protocol of part of a system. 总之,UML2.0中的状态机是传统状态机的一个发展,它支持 OO、层次化、并发性、通信等,以实现对现代复杂分布式系 统的建模
Review of statecharts Conventional state machine modeling techniques design of discrete-event system,such as reactive systems Limitations the complexity of the state diagram increases dramatically as the number of possible states increases lack of support for concurrent constructs 可以这样理解所谓传统状态机建模技术,即在David Harell的 Statecharts之前的那些状态机图,它们具有上述的两个主要的 缺点。 Tian Zhang Nanjing University 5
Tian Zhang @ Nanjing University 5 Review of statecharts Conventional state machine modeling techniques design of discrete-event system, such as reactive systems Limitations the complexity of the state diagram increases dramatically as the number of possible states increases lack of support for concurrent constructs 可以这样理解所谓传统状态机建模技术,即在David Harel的 Statecharts之前的那些状态机图,它们具有上述的两个主要的 缺点
Related work ■ Some related work recommending state machines for the user interface of interactive software; the specification of data-processing systems; hardware system description; the specification of communication protocols; computer aided instruction 注:以上均为上世纪70,80年代针对传统状态机的工作 Tian Zhang Nanjing University 6
Tian Zhang @ Nanjing University 6 Related work Some related work recommending state machines for : the user interface of interactive software; the specification of data-processing systems; hardware system description; the specification of communication protocols; computer aided instruction 注:以上均为上世纪70,80年代针对传统状态机的工作
Harel Statecharts David Harel The William Sussman Professorial Chair 0 Dept.of Computer Science and Applied Mathematics The Weizmann Institute of Science cofounder of i-Logix Inc. Research interests In the past,but diminished recent years computability and complexity theory,logics of programs,database theory,automata theory ▣recent years systems engineering,OO analysis and design,visual languages, layout of diagrams Tian Zhang Nanjing University
Tian Zhang @ Nanjing University 7 Harel Statecharts David Harel The William Sussman Professorial Chair Dept. of Computer Science and Applied Mathematics The Weizmann Institute of Science cofounder of i-Logix Inc. Research interests In the past, but diminished recent years – computability and complexity theory, logics of programs, database theory, automata theory recent years – systems engineering, OO analysis and design, visual languages, layout of diagrams
Warm up ■ How to model the following in conventional state machine diagrams 1.In all airborne states,when yellow handle is pulled seat will be ejected. 2.Gearbox change of state is independent of braking system. 3.When selection button is pressed enter selected mode. 4.Display-mode consists of time-display,date-display and stopwatch-display. Tian Zhang Nanjing University 8
Tian Zhang @ Nanjing University 8 Warm up How to model the following in conventional state machine diagrams : 1. In all airborne states, when yellow handle is pulled seat will be ejected. 2. Gearbox change of state is independent of braking system. 3. When selection button is pressed enter selected mode. 4. Display-mode consists of time-display, date-display and stopwatch-display
Warm up (2) In all airborne states,when yellow handle is pulled seat will be ejected calls for the ability to cluster states into a superstate Gearbox change of state is independent of braking system introduces independence,or orthogonality When selection button is pressed enter selected mode hints at the need for more general transitions than the single event-labelled arrow Display-mode consists of time-display,date-display and stopwatch-display captures the refinement of states Tian Zhang Nanjing University 9
Tian Zhang @ Nanjing University 9 Warm up (2) In all airborne states, when yellow handle is pulled seat will be ejected calls for the ability to cluster states into a superstate Gearbox change of state is independent of braking system introduces independence, or orthogonality When selection button is pressed enter selected mode hints at the need for more general transitions than the single event-labelled arrow Display-mode consists of time-display, date-display and stopwatch-display captures the refinement of states
Three Elements Statecharts extend conventional state-transition diagrams with essentially three elements Hierarchy Concurrency Communication In a nutshell,one can say 口 statecharts state-diagrams depth orthogonality broadcast-communication Tian Zhang Nanjing University 10
Tian Zhang @ Nanjing University 10 Three Elements Statecharts extend conventional state-transition diagrams with essentially three elements : Hierarchy Concurrency Communication In a nutshell, one can say : statecharts = state-diagrams + depth orthogonality + broadcast-communication