brief overview of uml diagrams with a simple example ece 417/617: elements of software engineering...
TRANSCRIPT
Brief Overview of UML Diagrams with a Simple Example
ECE 417/617:Elements of Software Engineering
Stan BirchfieldClemson University
A Simple Problem
1 5 V
light
switch
1. Use Case Diagram
SimpleCircuit
FlipOn
FlipOff
ViewLight
User
Functionality from user’s point of view
2. Class Diagram
Battery5V
Switch
Resistor Light
Structure of system (objects, attributes, associations, operations)
3. Interaction Diagram: (a) Sequence Diagram
ResistorSwitch Battery Light
Messages between objects
UserFlipOn() HeatUp() Drain()
Shine()
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
4. Statechart Diagram
Transitions between states of one object(Extension of Finite State Machine (FSM) model)
LightOff
LightOn
flipSwitchOn
flipSwitchOff
4. Statechart Diagram (different objects)
Cold Hot
flipSwitchOn
flipSwitchOff
NotDraining
Draining
flipSwitchOn
flipSwitchOff
(Resistor) (Battery)
5. Activity Diagram
Actions are states
Flip Switch On Flip Switch Off
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.