10
Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

Embed Size (px)

Citation preview

Page 1: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

Brief Overview of UML Diagrams with a Simple Example

ECE 417/617:Elements of Software Engineering

Stan BirchfieldClemson University

Page 2: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

A Simple Problem

1 5 V

light

switch

Page 3: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

1. Use Case Diagram

SimpleCircuit

FlipOn

FlipOff

ViewLight

User

Functionality from user’s point of view

Page 4: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

2. Class Diagram

Battery5V

Switch

Resistor Light

Structure of system (objects, attributes, associations, operations)

Page 5: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

3. Interaction Diagram: (a) Sequence Diagram

ResistorSwitch Battery Light

Messages between objects

UserFlipOn() HeatUp() Drain()

Shine()

Page 6: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

3. Interaction Diagram: (b) Collaboration Diagram

Resistor

More compact, but harder to interpret

User1. FlipOn()

1.1 HeatUp()

1.3 Drain()1.2 Shine()

Battery

Switch

Light

Page 7: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

4. Statechart Diagram

Transitions between states of one object(Extension of Finite State Machine (FSM) model)

LightOff

LightOn

flipSwitchOn

flipSwitchOff

Page 8: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

4. Statechart Diagram (different objects)

Cold Hot

flipSwitchOn

flipSwitchOff

NotDraining

Draining

flipSwitchOn

flipSwitchOff

(Resistor) (Battery)

Page 9: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

5. Activity Diagram

Actions are states

Flip Switch On Flip Switch Off

Page 10: Brief Overview of UML Diagrams with a Simple Example ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University

SummaryWe have looked at five diagrams:

1. Use case diagrams [Functional Model]-- models functionality from user’s point of view

2. Class diagrams [Object Model]-- models structure of system using objects

3. Interaction diagrams [Dynamic Model](sequence and collaboration)-- models messages passed between objects

4. Statechart diagrams [Dynamic Model]-- models transitions between states

5. Activity diagrams [Dynamic Model]-- models flow control as transitions between activities

The actual UML spec has 12 diagrams, but these five will be sufficient for us.