uml
DESCRIPTION
Ultimate PPT for UML...TRANSCRIPT
![Page 1: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/1.jpg)
UML Unified Modeling Language
Presented By-
Shah Imran Alam
CDAC- Mumbai
![Page 2: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/2.jpg)
Why We Model ?
What is UML ?
The UML language is for
Visualizing
Specifying
Constructing
Documenting
![Page 3: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/3.jpg)
Three major elements of UML
Building Blocks Rules Common Mechanism
![Page 4: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/4.jpg)
Building Blocks Of UML
Things
Relationship
Diagrams
![Page 5: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/5.jpg)
Four Kinds Of Things In UML
Structural Things Behavioral Things Grouping Things Annotational Things
![Page 6: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/6.jpg)
Structural Things (Nouns of UML)
Class Interface Collaboration Use Cases Active Classes Components Nodes
![Page 7: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/7.jpg)
Structural Things (Cont…)
The nouns of UML models are usually the static
parts of the system in question.
Class - an abstraction of a set of things in the problem-domain that have similar properties and/or functionality.
Notation:
Windoworiginsize
open()close()move()display()
![Page 8: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/8.jpg)
Structural Things (Cont…)
Notation:
Interface - A collection of operations that specify the services rendered by a class or component.
CheckSpelling
![Page 9: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/9.jpg)
Structural Things (Cont…)
Notation:
Collaboration - a collection of UML building blocks (classes, interfaces, relationships) that work together to provide some functionality within the system.
Chain Of Responsibility
![Page 10: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/10.jpg)
Structural Things (Cont…)
Notation:
Use Case - an abstraction of a set of functions that the system performs; a use case is “realized” by a collaboration.
Process
Order
![Page 11: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/11.jpg)
Structural Things (Cont…)
Notation:
Active Class - a class whose instance is an active object; an active object is an object that owns a process or thread (units of execution)
eventManager
![Page 12: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/12.jpg)
Structural Things (Cont…)
Notation:
Component - a physical part (typically manifests itself as a piece of software) of the system.
DML_Parser.C
![Page 13: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/13.jpg)
Structural Things (Cont…)
Notation:
Node - a physical element that exists at run-time and represents a computational resource (typically, hardware resources).
PrintServer
![Page 14: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/14.jpg)
Behavioral Things (Verbs of UML)
Interaction Static machine
![Page 15: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/15.jpg)
Behavioral Things (contd)
Interaction
The verbs of UML models; usually the dynamicparts 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.
ParseNotation:
![Page 16: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/16.jpg)
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.
Notation:EngineIdling
![Page 17: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/17.jpg)
Grouping Things (Packages)
The organizational part of the UML model, provides a higher level of abstraction (granularity).
A general-purpose element that comprises UML elements - structural, behavioral or even grouping things. Packages are conceptual groupings of the system and need not necessarily be implemented as cohesive software modules.
.
AccountsDepartment
Notation:
![Page 18: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/18.jpg)
Annotational Things (Note)
The explanatory part of the UML model; addsinformation/meaning to the model elements. A graphical notation for attaching constraints and/or
comments to elements of the model.
Notation:Parses user-query and builds expression stack ( invokes ErrorHandler)
![Page 19: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/19.jpg)
A Few Other Example
![Page 20: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/20.jpg)
Relationships In UML
Dependency Association Generalization Realization
![Page 21: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/21.jpg)
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).
(arrow-head points to the independent thing)Notation:
![Page 22: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/22.jpg)
Relationships (contd)
Association
A structural relationship that describes the connection between two things.
Notation:
![Page 23: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/23.jpg)
Associational (usage) relationships1. 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)
![Page 24: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/24.jpg)
An Example
Student Courseenroll
advisee
advisorFaculty
6..* 0..*
1
0..*Course
0..*
1
teach
1..*
1
![Page 25: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/25.jpg)
Association Class
Adds attributes and operations to an association– Allows exactly one instance of the association class
between any two objects– Can use an actual class instead, if you need more
PersonCompany0..* 1..*
Job
descriptiondateHiredsalary
employeeemployer
![Page 26: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/26.jpg)
Special cases of Association
Aggregation : "is part of" symbolized by a clear white diamond.
Composition : "is entirely made of“ symbolized by a black diamond.
![Page 27: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/27.jpg)
Aggregation
Special form of association representing has-a or part-whole relationship.
Distinguishes the whole (aggregate class) from its parts (component class).
No relationship in the lifetime of the aggregate and the components (can exist separately).
Aggregate Component
![Page 28: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/28.jpg)
Aggregation Example
room
wall
![Page 29: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/29.jpg)
Composition
Stronger form of aggregation
Implies exclusive ownership of the component class by the aggregate class
The lifetime of the components is entirely included in the lifetime of the aggregate (a component can not exist without its aggregate).
Composition Component
![Page 30: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/30.jpg)
A Composition Example
Document
Paragraph
Sentence
Word
0..*
1..*
1..*
![Page 31: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/31.jpg)
An Example
Department
member-of
Faculty
College
chair-of
Student
1
1 1
1
1 1
1..*
0..*1..*
1..*
University
![Page 32: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/32.jpg)
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)
![Page 33: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/33.jpg)
Generalization (inheritance) relationshipshierarchies 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
![Page 34: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/34.jpg)
An Example
![Page 35: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/35.jpg)
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)
![Page 36: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/36.jpg)
Realization (representations)
![Page 37: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/37.jpg)
Another example
![Page 38: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/38.jpg)
Diagrams with UML
UML includes nine diagrams - each capturing a different dimension of a software-system architecture.
Class DiagramObject DiagramUse Case DiagramSequence Diagram Collaboration Diagram
Statechart DiagramActivity DiagramComponent DiagramDeployment Diagram
![Page 39: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/39.jpg)
Common Mechanism
Mechanisms/elements that apply consistently throughout the language:
Specifications
Adornments
Common Divisions
Extensibility Mechanisms
![Page 40: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/40.jpg)
Adornments
visibility: + public
# protected- private/ derived
underline static methods/attributes
parameter types listed as (name: type)
Italics Abstract Class
![Page 41: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/41.jpg)
Common Division
There is a division of class and objects
Customer Joe : Customer
: Customernameaddressphone
Joe
![Page 42: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/42.jpg)
Common Division
There is a separation of Interface and Implementation
Spellingwizard.dll
IUnknown
ISpelling
![Page 43: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/43.jpg)
Extensibility Mechanism
Stereotype : Extends the vocabulary of the UML
Tagged value : Extends the properties of the UML
Constraints : Extends the semantics of the UML
EventQueue {version=3.4 author =sia}
add()removeflush()
<<exception>>Overflow {ordered}
![Page 44: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/44.jpg)
Another Example (Stereotype)
![Page 45: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/45.jpg)
Another Example (Tagged value)
![Page 46: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/46.jpg)
Another Example (Constraints)
![Page 47: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/47.jpg)
Revisiting Classes (Modeling advanced features)
Abstract, root and leaf elements
![Page 48: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/48.jpg)
Multiplicity
![Page 49: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/49.jpg)
Attributes
The Syntax of an attribute in the UML is
[visibility] name [multiplicity] [:type] [=initial-value] [{property-string}]
Example-
+ name [0..1] :String
origin : Point = (0,0)
id : integer {frozen}
Can be one ofchangeable, addOnly, frozen
![Page 50: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/50.jpg)
Operations
visibility name ( parameter-list ) : return-type { property-string }
can be: isQuery (does not change state of the object) sequential (should not be called concurrently) guarded (like synchronized)concurrent (canbe executed concurrently)
Parameters can be marked as in, out, inout
![Page 51: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/51.jpg)
Modeling static types (role-change)
![Page 52: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/52.jpg)
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.
![Page 53: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/53.jpg)
Visibility
![Page 54: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/54.jpg)
Qualification
![Page 55: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/55.jpg)
Interface Specifier
![Page 56: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/56.jpg)
Class Diagrams
DVD Movie VHS Movie Video Game
Rental Item
Rental Invoice
1..*1
Customer
Checkout Screen
0..1
1
Simple
Association
Class
Abstract
Class
Simple
Aggregation
GeneralizationComposition
Multiplicity
![Page 57: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/57.jpg)
Modeling a schema
![Page 58: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/58.jpg)
Object Diagram
![Page 59: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/59.jpg)
Interaction Diagram
Model the dynamic behaviour of the system; the flow of control within an operation.
Describe the interaction between objects; objects interact through messages to fulfill tasks.
Interaction provides behaviour and typically implements a Use Case.
Two types of interaction diagrams in UML– Sequence Diagrams (temporal dimension)– Collaboration Diagrams (structural dimension)
![Page 60: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/60.jpg)
Sequence Diagram
Sequence diagram is an interaction diagram that emphasizes the time-ordering of messages in an interaction.
Models interaction as a two-dimensional chart.
Objects participating in the interaction are plotted along the X-axis, time on the Y-axis.
Y-axis models the objects lifeline.
Messages passed between objects manifest the interaction.
![Page 61: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/61.jpg)
An Example
![Page 62: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/62.jpg)
Collaboration diagram
Collaboration diagram is an interaction diagram that emphasizes the structural organization of objects participating in an interaction.
It showsobjects / classes
links between them
message flow along links
Messages are numbered to show sequence
![Page 63: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/63.jpg)
An Example
![Page 64: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/64.jpg)
Use Case Diagram
Use Case Diagrams is the UML mechanism for requirements capture.
Use Case Diagrams are a graphical presentation of the “actors” in the domain and the “use cases” initiated by them.
“Use cases” are abstractions of discrete behavior exhibited by the system; perform a specific goal for an “actor”.
An “actor” is an abstraction of a role played by anyone or anything interacting with the system.
![Page 65: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/65.jpg)
Common Uses
To Model the context of the system To Model the requirements of the system.
![Page 66: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/66.jpg)
Modeling the context of the system
![Page 67: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/67.jpg)
Modeling the requirements of the system
![Page 68: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/68.jpg)
Another Example (A complete picture)
![Page 69: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/69.jpg)
Use Cases and Scenarios
A Use Case actually describes a set of sequences [of actions].
Each sequence represents one possible flow of actions in using the system.
Each sequence is called a Scenario.
A Scenario is basically one instance of a use case.– a Scenario is to a Use Case, what an Object is to a Class.
![Page 70: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/70.jpg)
Use Case Realization
The use case diagram is an external view of the system
A use case is realized in a collaboration
A collaboration shows an internal implementation- dependent solution of a use case in terms of:
– classes/objects– their relationships– their interaction
![Page 71: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/71.jpg)
Realization (A Higher level of Abstraction)
![Page 72: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/72.jpg)
Realization
Use Case A:ClassA :ClassB
:ClassC :ClassD
1: msg1
2: msg2
3: msg3
A Collaboration
Class A
Oper1()...
Class B
Oper2()...
Class C
Oper3()...
<<implements>> <<implements>> <<implements>>Use Case A description1. Step 12. Step 23. ...
![Page 73: Uml](https://reader037.vdocuments.us/reader037/viewer/2022102814/548be358b47959da5e8b4586/html5/thumbnails/73.jpg)