Professional Documents
Culture Documents
Uml
Uml
Uml
Presented By-
Shah Imran Alam
CDAC- Mumbai
Why We Model ?
What is UML ?
Building Blocks
Rules
Common Mechanism
Building Blocks Of UML
Things
Relationship
Diagrams
Four Kinds Of Things In UML
Structural Things
Behavioral Things
Grouping Things
Annotational Things
Structural Things (Nouns of UML)
Class
Interface
Collaboration
Use Cases
Active Classes
Components
Nodes
Structural Things (Cont…)
Notation:
CheckSpelling
Structural Things (Cont…)
Notation: Chain Of
Responsibility
Structural Things (Cont…)
Process
Notation:
Order
Structural Things (Cont…)
Notation: eventManager
Structural Things (Cont…)
DML_Parser.C
Notation:
Structural Things (Cont…)
PrintServer
Notation:
Behavioral Things (Verbs of UML)
Interaction
Static machine
Behavioral Things (contd)
Interaction
The verbs of UML models; usually the dynamic
parts of the system in question.
some behaviour constituted by messages exchanged
among objects; the exchange of messages is with a view to
achieving some purpose.
Parse
Notation:
Behavioral Things (contd)
State machine
A behavior that specifies the sequence of “states” an
object goes through, during its lifetime. A “state” is a
condition or situation during the lifetime of an object
during which it exhibits certain characteristics and/or
performs some function.
Engine
Notation: Idling
Grouping Things (Packages)
Accounts
Notation:
Department
Annotational Things (Note)
Parses user-query
Notation: and builds
expression stack
( invokes
ErrorHandler)
A Few Other Example
Relationships In UML
Dependency
Association
Generalization
Realization
Relationships (contd)
Dependency
Articulates the meaning of the links between
things.
A semantic relationship where a change in one thing (the
independent thing) causes a change in the semantics of
the other thing (the dependent thing).
Notation:
(arrow-head points to the independent thing)
Relationships (contd)
Association
Notation:
Associational (usage) relationships
1. multiplicity (how many are used)
* ⇒ 0, 1, or more
1 ⇒ 1 exactly
2..4 ⇒ between 2 and 4, inclusive
5..* ⇒ 5 or more
2. name (what relationship the objects have)
3. navigability (direction)
An Example
1
1
Faculty1
advisor
Association Class
Job
description
dateHired
salary
Special cases of Association
Aggregate Component
Aggregation Example
room
wall
Composition
Composition Component
A Composition Example
Document
0..*
Paragraph
1..*
Sentence
1..*
Word
An Example
University
1..*
1 1..* 1 0..*
College Department Student
1 1
chair-of member-of
1 1..*
Faculty
Relationships (contd)
Generalisation
A relationship between a general thing (called “parent”
or “superclass”) and a more specific kind of that thing
(called the “child” or “subclass”), such that the latter
can substitute the former.
Notation:
(arrow-head points to the superclass)
Generalization (inheritance) relationships
hierarchies drawn top-down with arrows
pointing upward to parent
line/arrow styles differ, based on whether
parent is a(n):
class:
solid line, black arrow
abstract class:
solid line, white arrow
An Example
Relationships (contd)
Realization
A semantic relationship between two things wherein one
specifies the behavior to be carried out, and the other
carries out the behavior.
Notation:
(arrow-head points to the thing being
realized)
Realization (representations)
Another example
Diagrams with UML
visibility:
+ public
# protected
- private
/ derived
name
address : Customer
phone
Joe
Common Division
Spellingwizard.dll
IUnknown
ISpelling
Extensibility Mechanism
EventQueue
{version=3.4
author =sia}
<<exception>>
Overflow
add() {ordered}
remove
flush()
Another Example (Stereotype)
Another Example (Tagged value)
Another Example (Constraints)
Revisiting Classes (Modeling advanced features)
Example-
+ name [0..1] :String
origin : Point = (0,0)
id : integer {frozen}
Operations
visibility name ( parameter-list ) : return-type { property-string }
Parameters can be marked as
can be:
in, out, inout
isQuery (does not change state of the object)
sequential (should not be called concurrently)
guarded (like synchronized)
concurrent (canbe executed concurrently)
Modeling static types (role-change)
Revisiting Association (Modeling advanced features)
Navigation
Unless otherwise specified, navigation across an
association is bidirectional.
Navigation could be limited to one direction. By
specifying the direction of traversal.
Visibility
Qualification
Interface Specifier
Class Diagrams
Multiplicity
Customer Simple
1
Class Aggregation
Checkout Screen
DVD Movie VHS Movie Video Game
Modeling a schema
Object Diagram
Interaction Diagram