33
Unified Modeling Language (UML) CSCI 6050 Software Engineering January 19, 2005 Trentin Bishop Micah Lewis Amit Mathew Rufin Tshinanga Stephen Upchurch

Uml

Embed Size (px)

Citation preview

Page 1: Uml

Unified Modeling Language (UML)

CSCI 6050 Software EngineeringJanuary 19, 2005

Trentin BishopMicah LewisAmit Mathew

Rufin TshinangaStephen Upchurch

Page 2: Uml

Why do we need models?

To create a simplified representation of a real software system

Page 3: Uml

What is UML?

A popular, standardized modeling language for object-oriented software

The Object Management Group (OMG) is the group that dictates the UML standard

Created by Grady Booch, James Rumbaugh, and Ivar Jacobson

Page 4: Uml

UML Models

Functional ModelsUse case diagrams

Structural ModelsClass diagrams

Dynamic/Behavioral ModelsStatechart diagramsSequence diagramsActivity diagrams

Page 5: Uml

UML Conventions

Rectangles are classes or instancesOvals are functions or use casesInstances are underlinedTypes are not underlined

Page 6: Uml

Use case diagrams

Page 7: Uml

Use case diagrams

Describes the functional behavior of the system from the user’s point of view

Used during the requirements elicitation stage to represent external behavior

Actor: User, external system, or a physical environment

Use case: a class of functionality provided by the system as an event flowHas entry and exit conditions, flow of events, and

participating actors

Page 8: Uml

Use case diagram symbols

Actor

Relationships

Use case

System

Page 9: Uml

Use case example

Find arrival times

Report location

Report error

GPS SystemPassenger

Page 10: Uml

Use case example explanation

Actors don’t have to be peopleShows how actors interact with the

systemThree use cases

Page 11: Uml

Class diagrams

Page 12: Uml

UML Class Diagram

Depict the classes within the modelIllustrates the class attributes (member

variables), operations (member functions), and relationships with other classes

Page 13: Uml

UML Class Diagram Symbols

CLASS Class Name

Composition relationshipClass 1 is composed of a Class 2

Class 1 Class 2

Inheritance relationshipClass 2 and Class 3 derive from Class 1

#Number of links each class object may contain

Class 1

Class 2 Class 3

Class 1 Class 2 AggregationA collection of other classes

Page 14: Uml

UML Class Diagram Example

SimpleWatch

PushButton Display Battery Time1

1111

1 22

SimpleWatch class contains 2 PushButtons 1 Display 2 Batteries 1 Time

Page 15: Uml

UML Class Diagram Example

http://pigseye.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/class.htm

Page 16: Uml

UML Class Diagram Example

The class Order is associated with the class CustomerThe multiplicity denotes the number of objects

For example, Order object can be associated only one customer but a customer can be associated to many orders

Page 17: Uml

Statechart diagrams

Page 18: Uml

UML Statechart Diagram

A statechart diagram shows the behavior of classes in response to external stimuli

This diagram models the dynamic flow of control from state to state within a system.

Page 19: Uml

Basic Statechart Diagram Symbols and Notations

States represent situations during the life of an object

A solid arrow represents the path between different states of an object

A filled circle followed by an arrow represents the object's initial state.

An arrow pointing to a filled circle nested inside another circle represents the object's final state.

Page 20: Uml
Page 21: Uml

Description of state chart diagram

State: Display alarm time Display clock time No sound Sound on Buzzing Playing radio

Transition: On Off Hold alarm Alarm switch off Change Hrs/Min Radio

Activity: Do/wait for clock time to alarm time

Page 22: Uml

Sequence diagrams

Page 23: Uml

Sequence Diagrams

Describe the dynamic behavior between actors and the system and between objects of the system

Used during requirements analysisTo refine use case descriptionsTo find additional objects

Used during system designTo refine subsystem interfaces

Page 24: Uml

Sequence diagram notation

Classes are represented by columnsMessages are represented by arrowsActivations represented by narrow

rectanglesLifelines are represented by dashed lines

Page 25: Uml

Example:- sequence diagram for SimpleWatch

O

- | - :SimpleWatch :Display :Time

/ \ | | |

:WatchUser | | |

pressButton1() blinkHours() |

――――――― ―――――――――――― |

pressButton1() | blinkMinutes() | |

――――――― ―――――――――――― |

|

pressButton2() | | |

――――――― | incrementMinutes() |

――――――――――――――――――――――――――――――

| | refresh()

pressButton1And2() | ―――――――――――――

――――――― |

| commitNewTime() |

―――――――――――――――――――――――――――――――

|

stopBlinking()

―――――――――――――

Page 26: Uml

Example cont.

-The left-most column represents the timeline of the WatchUser who initiates the use case.

-The other columns represent the timeline of the objects that participate in this use case.

References: Page 33 Object-Oriented Software Engineering Bernd Bruegge, Allen H. Dutoit

Page 27: Uml

Activity diagrams

Page 28: Uml

Activity Diagrams

Used to represent the behavior of a system in terms of activities and their precedence constraints

Compared to flowchart diagrams because … They can be used to represent control flow (order in which

operations occur) They can be used to represent data flow (objects exchanged

among operations)

The completion of an activity triggers an outgoing transition which may initiate another activity

Page 29: Uml

Symbols

- Synchronization of the control flow

- Activities in the system

- Transitions between activities

Page 30: Uml

Activity Diagram Example

OpenIncident

DocumentIncident

AllocateResources

CoordinateResources

ArchiveIncident

Page 31: Uml

Example Explained

The 1st activity initiated is Open Activity. After all the operations in this activity have been executed, the activities Allocate Resources, Coordinate Resources & Document Incident are initiated. (Note: There is a complex transition between Open Activity and the next three activities).

These three activities may occur in sequence or concurrently.

Even if the three activities don’t occur concurrently, Archive Incident is not initiated until all three have been completed.

Page 32: Uml

References

B. Bruegge, A. Dutoit. Object-Oriented Software Engineering: Using UML, Patterns and Java, Second Edition. 2003.

Page 33: Uml

Questions?