Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 37

Unified Modeling Language (UML)

an overview

Specification and Analysis of Information Systems Spring 2005 1


Outlines

– The Collaboration diagram


– The Statechart diagram
– The Component diagram
– The Deployment diagram

Unified Modeling Language (UML): an overview, Session 4 2


Collaboration Diagram

Unified Modeling
Specification Language
and Analysis (UML): an overview,
of Information Systems Session 4 Spring 2005 3
The Collaboration Diagram
 The Collaboration diagram offers an alternative to the Sequence diagram

 Both diagrams model the interactions between objects. But, the


perspective is different
 The Collaboration diagram focus on Object Roles rather than Timing

 The Collaboration diagram models the messages on top of an Object


diagram. Each message has a sequence number

 The collaboration diagram may be used to:

 Describe a specific scenario by depicting the movement of messages


between objects
 Show a spatial organization of objects and their interactions, rather than the
sequence of the interactions
 Discover the need for new associations between classes

Unified Modeling Language (UML): an overview, Session 4 4


Building The Collaboration Diagram
The Collaboration diagram is built on top of an Object diagram:
1. Place the participating objects on the diagram

2. Draw the links between the objects using the Class diagram as your
guide

3. Add each event. Place the message arrow parallel to the link
between the two objects. Position the arrow to point from the sender
to the receiver

4. Number the messages in order of execution

5. Repeat steps 3 and 4 until the entire scenario has been modeled

Unified Modeling Language (UML): an overview, Session 4 5


The Sequence diagram of the Scenario 1

Unified Modeling Language (UML): an overview, Session 4 6


The Collaboration diagram of the Scenario 1

Unified Modeling Language (UML): an overview, Session 4 7


The Sequence diagram of the Scenario 2

Scenario 2

Unified Modeling Language (UML): an overview, Session 4 8


The Collaboration diagram of the Scenario2

Unified Modeling Language (UML): an overview, Session 4 9


Statechart Diagram

Unified Modeling
Specification Language
and Analysis (UML): an overview,
of Information Systems Session 4 Spring 2005 10
Statechart Diagrams
• We use Statechart diagrams to show:
• The life history of a given class, use case, operation
• The events that cause a transition form one state to another
• The actions that result from a state change

• Statechart diagrams describe the behavior of a class in response to


external stimuli

• A Statechart diagram shows the possible states of the object and


the transitions that cause a change in state

Unified Modeling Language (UML): an overview, Session 4 11


Building Statechart Diagrams

The Statechart diagrams contain the following elements:


States, which represent the situations during the life of an object in which
it satisfies some condition, performs some activity, or waits for some
occurrence
-States are rounded rectangles

Transitions, which represent relationships between the different states of


an object
- Transitions are arrows from one state to another

Events, which trigger a transition (a change in state)


- Events or conditions that trigger transitions are written beside the arrows

Unified Modeling Language (UML): an overview, Session 4 12


Statechart Diagram for The Product Class/Object

Unified Modeling Language (UML): an overview, Session 4 13


Transitions

event [guard] | action


xx yy

The event that Conditions that The action that


triggers the must be met for takes place when
transition the transition to the transition is
take place taken

X and Y are two States

Unified Modeling Language (UML): an overview, Session 4 14


States & Classes
‫الطلب في قسم معالجة الطلبات‬
State
Class view State view
created
created
Order Transition

SerialNmbre:Int.s
in
in Treatment
Treatment
CustomerName:Str.
hasProblems : boolean

stored
stored
CreateOrder()

StoreOrder()

in the OrdersDB in problem

Intro | Building Blocks | Advanced 15


Events
• General Events
– Method calls: created
created
StoreOrder(customer)
• Time event ChekCustomerInformation()
– interval expiry;
In
In Treatment
Treatment
tm(3 days), tm(1000 ms)
– calendar/clock time: when(11h:50) StoreOrder()
• Change Event: stored
stored
– Change in value of some attribue: True(hasProblems)
false(hasProblems)
true(hasProblems)
in problem
In the OrdersDB

16
Statechart Diagram for The Product Class/Object

17
Component Diagram

Unified Modeling
Specification Language
and Analysis (UML): an overview,
of Information Systems Session 4 Spring 2005 18
Component diagram
• The purpose of the Component diagram is to define software
modules and their relationships
• Each component is a chunk of code that resides in memory on a
piece of hardware
• The UML groups components into three broad categories:
– Deployment components, which are required to run the system
– Work product components including source code and data files used to
create deployment components
– Execution components, which are components created while running
the application

Unified Modeling Language (UML): an overview, Session 4 19


Component diagram notations

Unified Modeling Language (UML): an overview, Session 4 20


Component diagram
• Some common components:
– <<executable>>: A component that runs on a processor
– <<library>>: A set of resources referenced by an executable during runtime
– <<table>>: A database component accessed by an executable
– <<file>>: Typically represents data or source code
– <<document>>: A document such as a page inserted into a Web page

Unified Modeling Language (UML): an overview, Session 4 21


Elements of component diagram

• Component: The objects interacting with each other in the


system

• Class/Interface/Object: similar to the notations used in class


and object diagrams

• Realization/Association: Similar to the relation/association


used in class diagrams

Unified Modeling Language (UML): an overview, Session 4 22


Interfaces
• Interface encapsulates the internal behavior of a
class and its signature
• It is actually, a contract, that each implementing
class must honor

Implementation Interface External Object


Operation
Operation 1
1 Impl’ Operation 1 Declaration
Operation
Operation 1 1
Operation
Operation 2
2 impl’ Operation 2 Declaration

Unified Modeling Language (UML): an overview, Session 4 23


Interface Notations
The lollipop notation

Provided Required
Interface

Component 1
Component 2
CommonObject

« interface»
CommonObjec

uniqueID : ID
width : int
The Class notation
height : int
create()
move()
delete()
display()

Unified Modeling Language (UML): an overview, Session 4 24


Building Component diagram

Components dependencies and dependency stereotypes

Unified Modeling Language (UML): an overview, Session 4 25


Building Component diagram

Adding two more resource components and the dependencies

Unified Modeling Language (UML): an overview, Session 4 26


Building Component diagram

Adding the user interface application and the shared interface

Unified Modeling Language (UML): an overview, Session 4 27


Building Component diagram

The OrderEntry.exe is created from multiple source classes

Unified Modeling Language (UML): an overview, Session 4 28


Deployment Diagram

Unified Modeling
Specification Language
and Analysis (UML): an overview,
of Information Systems Session 4 Spring 2005 29
Deployment Vs Component
• Component diagrams shows the configuration of
run-time processing elements and the software
components, processes and objects that live on
them
• Deployment diagrams may be used to show which
components may run on which nodes

Unified Modeling Language (UML): an overview, Session 4 30


The Deployment Diagram

Deployment diagrams describe the configuration of processing


resource elements and the mapping of software
implementation components on them
These diagrams contain components and nodes, which
represent processing or computational resources, including
computers, printers, etc.

Unified Modeling Language (UML): an overview, Session 4 31


Deployment diagram: Example

Unified Modeling Language (UML): an overview, Session 4 32


The Deployment Diagram
• The Deployment diagram models the hardware architecture by identifying the
processors
• Processors are typically computers but may also be people who perform manual
processing
• Nodes, or processors, may contain and run software components
• Node connections are modeled as associations, complete with stereotypes for names
and multiplicity
• A node may be modeled like a class with attributes and behaviors. However, many
modeling tools do not support this view
• Component and Deployment diagrams may be combined. Components reside on a
node. Component icons are placed inside the expanded node icon
• Communication between components on the nodes is modeled as dependencies
• The dependencies model the logical communication requirements. The nodes model
the communication associations that represent the physical communication paths like
TCP or Ethernet

Unified Modeling Language (UML): an overview, Session 4 33


Deployment diagram: Case Study

Supplying the node associations


to represent the physical connections

Unified Modeling Language (UML): an overview, Session 4 34


Deployment diagram: Case Study

Adding the components (and their


dependencies) that reside on the
MiddleTierServer node

Unified Modeling Language (UML): an overview, Session 4 35


Deployment diagram: Case Study

Unified Modeling Language (UML): an overview, Session 4 36


Thank you for your attention

Questions ?

Specification and Analysis of Information Systems Spring 2005 37

You might also like