Using UML to Explore Traffic Controller Logic

TRB Traffic Signal Systems Committee Architecture Subcommittee July 20, 2008 Mid-Year Meeting Using UML to Explore Traffic Controller Logic Prepared ...
Author: Daisy Cross
7 downloads 0 Views 5MB Size
TRB Traffic Signal Systems Committee Architecture Subcommittee July 20, 2008 Mid-Year Meeting

Using UML to Explore Traffic Controller Logic Prepared By Larry Head University of Arizona 1

Outline •

A Walk though UML – Capturing Requirements: Use Cases – Structural Modeling: g • Packages, Objects & Classes • Relationships • Generalization (Inheritance & Polymorphism)

– Use Case Realization: • Sequence Diagrams

– Behavioral Modeling • Activity Diagrams • State Diagrams

– Implementation & Deployment



UML for Traffic - Team Modeling Exercise(s) – – – – –



Exercise #1 - Use Case and Class Modeling Exercise #2 - Use Case Realization Exercise #3 - Process (State and Activity) Modeling Exercise #4 - Review the Model (does it work?) Exercise #5 - Implementation and Component

What’s Next? SysML! 2

What is UML? ? A new magic way to write software without knowing g about C,, C++,, Java,, Ada, Python, …… ? A standardized language from the software industry used to design and specify the functionality of software oriented systems 3

References

4

The Unified Process Structural View

Implementation View

Use Case View Process View

Deployment View

5

The Unified Process • Use Case (Requirements) Driven • Architecture Centric • Iterative & Incremental Structural View

Implementation View

Use Case View Process View

Deployment View

6

What is a UML Model • Specification of – – – – – –

Use Cases Cl Classes/Objects /Obj t Packages Relationships Interfaces Software C Components t – Deployment p Specificaitons Diagrams for Visualization

7

Context Diagram is not standard UML diagram type (Class diagram used for this example)

Context Diagram

8

Use Case View

9

Use Case Specification • • • •

Name/ID Actors Preconditions Primary Flow – 1. 1 The use case begins begins……

• Post-conditions • Alternative Flow • Derived Requirements

10

Design View

Class Diagram

11

What is a Class? • A “noun” in the use cases • Has clear role and responsibility • Data+Behavior

12

Design View - Stereotypes A class that contains persistent data p

A class that contains the details of an algorithm

A class that knows how to interact with an outside system

13

Design View - Objects: Instances of Classes Objects Class

14

Design View - Packages • Container for organization • Separate functions and work so Teams can do d d development l t • Namespace variables i bl

15

Design View - Relationships 9 Association p y • Dependency • Aggregation p 9 Composition 9 Generalizatio n 9 Realization e ace 9 Interface 16

Process View - Use Case Realization: Sequence Diagrams Objects

Lifeline Time

??? Catalog -> CardProcessingCo

Operations “Messages” 17

Design View - Class Diagram (Original)

18

Revised Class Diagram

19

Revised Sequence q Diagram g

20

Process View - Activity Diagram

21

Process View - State Diagram

22

Implementation View Components • Software Components that can be Deployed on devices that have processors & memory (called Nodes) 23

Implementation View Components

24

Implementation View Components

25

Implementation View Components

26

Deployment View

27

Exercise #1: Use Case + Classes • Consider basic traffic control – Group: Brainstorm Use Cases – Breakout: • Use Case Specs • Classes • 20 Minutes

28

Use Cases •

Use Cases – – – – – – – – – – – – – –

Detect Cars Control Flow on Movement Detect Peds Detect EV’s Detect Train Detect Transit Vehicles Report Status/Faults Maintain Coordination Modify Operational g Parameters/Config Perform Diagnostics Log events Collect Performance Data Manual Control Priority Treatment



Actors – – – – – – – – – –

Vehicle Ped EV Transit RailRoad Time Central System Technician On-Street Master Police

29

Exercise #2: Use Case Realization • Given Use Cases and Class Definitions – Generate a sequence diagram for your Use Case – Add Operations p and Attributes as needed – 20 Minutes 30

Exercise #3: Process (State and Activity) Modeling • Define the logic to implement the Behavior in the Sequence Diagrams – Generate an Activity Diagram for one Behavior – Generate a State Model f one Entity/Activity for / – 20 Minutes

31

Exercise #4: Review the Model - Does it work?

Implementation View

Structural View

Use Case View

Process View

Deployment View

32

Exercise #5: Implementation & Component • Define software components • Define hardware and deployment components t – Alternatives?

33

Summary Comments • UML is a language to describe software • The Unified Process – Use Case (Requirements) Driven – Architecture Centric – Iterative & Incremental

• What’s Wh t’ Next? N t? S SysML ML – www.omgsysml.org 34

SysML Diagram Taxonomy SysML Diagram

Behavior Diagram

Activity Diagram

Sequence Diagram

Requirement Diagram

State Machine Diagram

Use Case Diagram

Structure Diagram

Block Definition Diagram

Internal Block Diagram

Same as UML 2

Package Diagram

Parametric Diagram

Modified from UML 2 New diagram type

35 Copyright © 2006,2007 by Object Management Group.

36

37

38

39

Suggest Documents