How Can You Explain The Effect of Or: Polluted Water Global Warming
How Can You Explain The Effect of Or: Polluted Water Global Warming
Structure diagram
Object diagram
Class diagram
Component diagram
Deployment diagram
Package diagram
Composite structure diagram (UML 2.2)
Profile diagram (UML 2.2)
Behavior diagram
Interaction diagrams:
Sequence diagram
Collaboration diagram (communication diagram in UML 2.2)
Interaction overview diagram (UML 2.2)
Timing diagram (UML 2.2)
Use case diagram
Activity diagram
State diagram
SYSTEMS, MODELS AND VIEWS
Examples:
System: Aircraft
Models: Flight simulator, machine model
Views: Radar, electrical wiring, fuel system
SYSTEMS, MODELS AND VIEWS
Flightsimulator
Weather
Radar
Aircraft
Model 2
View 2
View 1
System
View 3
Model 1
Electrical
Wiring
Machine Model
UML MODELS, VIEWS, DIAGRAMS
UML is a multi-diagrammatic language
Each diagram is a view into a model
Diagram presented from the aspect of a particular stakeholder
Provides a partial representation of the system
Is semantically consistent with other views
Example views:
MODELS, VIEWS, DIAGRAMS
HOW MANY VIEWS?
Use Cases
Capture requirements
Domain Model
Capture process, key classes
Design Model
Capture details and behaviors of use cases and domain objects
Add classes that do the work and define the architecture
UML BASELINE
description.
Examples:
Passenger: A person in the train
GPS satellite: Provides the system with GPS
coordinates
USE CASE
A use case represents a class of
functionality provided by the system as
an event flow.
Exit condition:
Passenger has ticket.
THE <<EXTENDS>> RELATIONSHIP
<<extends>> relationships
Passenger represent exceptional or
seldom invoked cases.
The exceptional event flows
are factored out of the main
PurchaseTicket event flow for clarity.
<<extends>>
<<extends>>
<<extends>> TimeOut
<<includes>> relationship
Passenger represents behavior that
PurchaseMultiCard
is factored out of the use
case.
<<includes>> behavior is
PurchaseSingleTicket <<includes>> factored out for reuse, not
<<includes>> because it is an
exception.
The direction of a
CollectMoney <<includes>> relationship
<<extends>> <<extends>> is to the using use case
(unlike <<extends>>
relationships).
NoChange Cancel
USE CASES ARE USEFUL TO…
Determining requirements
New use cases often generate new requirements as the system is analyzed and the design
takes shape.
Communicating with clients
Their notational simplicity makes use case diagrams a good way for developers to
communicate with clients.
Generating test cases
The collection of scenarios for a use case may suggest a suite of test cases for those
scenarios.
Explain?
USE CASE DIAGRAMS: SUMMARY
Explain?
Name
TariffSchedule
TariffSchedule Table zone2price
zone2price Attributes Enumeration getZones()
getZones() Price getPrice(Zone)
getPrice()
Operations
Signature
TariffSchedule
A class represent a concept
A class encapsulates state (attributes) and behavior (operations).
Each attribute has a type.
Each operation has a signature.
The class name is the only mandatory information.
UML CLASS NOTATION
A class is a rectangle divided into three parts
Class name
Class attributes (i.e. data members, variables)
Class operations (i.e. methods)
Modifiers
Private: -
Public: +
Protected: #
Static: Underlined (i.e. shared among all members of the class)
Abstract class: Name in italics
Employee
-Name : string
+ID : long
#Salary : double
+getName() : string
+setName()
-calcInternalStuff(in x : byte, in y : decimal)
UML CLASS NOTATION
myB.service(); myA.doSomething()
;
Example?
Employee
Team
-Name : string
-members : Employee +ID : long
1 #Salary : double
-adfaf : bool
*
+getName() : string
+setName()
-calcInternalStuff(in x : byte, in y : decimal)
members[0] =
new
Employee(); Filled diamond on side of
… the Collection
delete
members[0];
INHERITANCE
Standard concept of inheritance
Base Class
Derived Class
Multiplicities Meaning
zero or one instance. The notation n . . m
0..1
indicates n to m instances.
no limit on the number of instances
0..* or *
(including none).
1 exactly one instance
1..* at least one instance
UML CLASS EXAMPLE
ASSOCIATION DETAILS
Employee
Team -group
Can -Name : string
assign
-members names to the ends of
: Employee the association
-individual +ID : long to give further information
1 #Salary : double
-adfaf : bool
*
+getName() : string
+setName()
-calcInternalStuff(in x : byte, in y : decimal)
STATIC VS. DYNAMIC DESIGN
Format is
Instance name : Class name
Attributes and Values
Example:
OBJECTS AND LINKS
To organize complex class diagrams, you can group classes into packages. A
package is a collection of logically related UML elements
Notation
Packages appear as rectangles with small tabs at the top.
The package name is on the tab or inside the rectangle.
The dotted arrows are dependencies. One package depends on another if changes in the
other could possibly force changes in the first.
Packages are the basic grouping construct with which you may organize UML models to
increase their readability
PACKAGE EXAMPLE
Dispatcher Interface
Notification IncidentManagement
MORE PACKAGE EXAMPLES
INTERACTION DIAGRAMS
2
Activation 3
Shows Destruction of b
(and Construction)
SEQUENCE EXAMPLE: ALARM
SYSTEM
When the alarm goes off, it rings the alarm, puts a message on the display, notifies
the monitoring service
SEQUENCE DIAGRAM EXAMPLE
Hotel Reservation
COLLABORATION DIAGRAM
Fancy flowchart
Displays the flow of activities involved in a single process
States
Describe what is being processed
Indicated by boxes with rounded corners
Swim lanes
Indicates which object is responsible for what activity
Branch
Transition that branch
Indicated by a diamond
Fork
Transition forking into parallel activities
Indicated by solid bars
Start and End
SAMPLE ACTIVITY DIAGRAM
Ordering System
May need multiple diagrams from
other points of view
ACTIVITY DIAGRAM EXAMPLE
STATE TRANSITION DIAGRAMS
The set of properties and values describing the object in a well defined instant are
characterized by
Name
Activities (executed inside the state)
Do/ activity
Actions (executed at state entry or exit)
Entry/ action
Exit/ action
Actions executed due to an event
Event [Condition] / Action ^Send Event
NOTATION FOR STATES
SIMPLE TRANSITION EXAMPLE
MORE SIMPLE STATE EXAMPLES
STATE TRANSITION EXAMPLE
Validating PIN/SSN
STATE CHARTS – LOCAL VARIABLES
Is-Member Clean-Up
Return /
N=N-1
COMPONENT DIAGRAMS
Components are shown as rectangles with two tabs at the upper left
Restaurant ordering
system
Define interfaces
first – comes from
Class Diagrams
COMPONENT EXAMPLE -
COMPONENTS
Graphical depiction
of components
COMPONENT EXAMPLE - LINKING
Linking
components
with
dependencies
DEPLOYMENT DIAGRAMS
Shows the physical architecture of the hardware and software of the deployed
system
Nodes
Typically contain components or packages
Usually some kind of computational unit; e.g. machine or device (physical or logical)
Physical relationships among software and hardware in a delivered systems
Explains how a system interacts with the external environment
SOME DEPLOYMENT EXAMPLES
DEPLOYMENT EXAMPLE