SlideShare a Scribd company logo
1 of 36
1
Introduction to Unified
Modeling Language
By,
D. B. Naga Muruga,
Dept of Mechanical Engineering,
Sriram Engineering College
2
UML for OOAD
2.1 What is UML?
2.2 Classes in UML
2.3 Relations in UML
2.4 Static and Dynamic Design with UML
3
2.1 UML Background
"The Unified Modelling Language (UML) is a graphical
language for visualizing, specifying, constructing, and
documenting the artifacts of a software-intensive system.
The UML offers a standard way to write a systems blueprints,
including conceptual things like business processes
and system functions as well as concrete things such as
programming language statements, database schemas, and
reusable software components."
Grady Booch, Ivar Jacobsen, Jim Rumbaugh
Rational Software
[OMG Unified Modelling Language Specification, Version 1.3, March 2000]
4
2.1 Brief UML History
 Around 1980
 first OO modelling languages
 other techniques, e.g. SA/SD
 Around 1990
 "OO method wars"
 many modelling languages
 End of 90's
 UML appears as combination of best practices
5
2.1 Why UML?
 Physicists know formal graphical modelling
 Mathematics to describe nature
 Feynman graphs to calculate particle reaction rates
 We need a common language
 discuss software systems at a black- (white-) board
 document software systems
 UML is an important part of that language
 UML provides the "words and grammar"
6
2.2 Classes in UML
 Classes describe objects
 Interface (member function signature)
 Behaviour (member function implementation)
 State bookkeeping (values of data members)
 Creation and destruction
 Objects described by classes collaborate
 Class relations → object relations
 Dependencies between classes
7
2.2 UML Class
Class name
Data members
Instance methods
Arguments
Return types
Data members, arguments and methods are specified by
visibility name : type
Class method
8
2.2 Class Name
The top compartment
contains the class name
Abstract classes have italicised
names
Abstract methods also have
italicised names
Stereotypes are used to identify
groups of classes, e.g interfaces
or persistent (storeable) classes
9
2.2 Class Attributes
Attributes are the instance
and class data members
Class data members (underlined)
are shared between all instances
(objects) of a given class
Data types shown after ":"
Visibility shown as
+ public
- private
# protected
Attribute
compartment
visibility name : type
10
2.2 Class Operations (Interface)
Operations are the class
methods with their argument
and return types
Public (+) operations define the
class interface
Class methods (underlined)
have only access to class data
members, no need for a class
instance (object)
Operations
compartment
visibility name : type
11
2.2 Visibility
+
public
Anyone can access
Interface operations
Not data members
-
private
No-one can access
Data members
Helper functions
"Friends" are allowd
in though
#
protected
Subclasses can access
Operations where sub-
classes collaborate
Not data members
(creates dependency
off subclass on im-
plementation of parent)
12
2.2 Template Classes
Generic classes depending on parametrised types
Type parameter(s)
Operations compartment
as usual, but may have
type parameter instead of
concrete type
13
2.3 Relations
 Association
 Aggregation
 Composition
 Parametric and Friendship
 Inheritance
14
2.3 Binary Association
Binary association: both classes know each other
Usually "knows about" means a pointer or reference
Other methods possible: method argument, tables, database, ...
Implies dependency cycle
15
2.3 Unary Association
A knows about B, but B knows nothing about A
Arrow shows direction of
association in direction of
dependency
16
2.3 Aggregation
Aggregation = Association with "whole-part" relationship
Shown by hollow diamond
at the "whole" side
No lifetime control implied
17
2.3 Composition
Composition = Aggregation with lifetime control
Shown by filled diamond
at the "owner" side
Lifetime control implied
Lifetime control can be
tranferred
Lifetime control: construction and
destruction controlled by "owner"
→ call constructors and destructors
(or have somebody else do it)
18
2.3 Association Details
Name gives details of association
Name can be viewed as verb of a sentence
Notes at association ends
explain "roles" of classes (objects)
Multiplicities show number of
objects which participate in the
association
19
2.3 Friendship
Friends are granted access to private data members and
member functions
Friendship is given to other classes, never taken
Bob Martin:
More like lovers than friends.
You can have many friends,
you should not have many lovers
Friendship breaks data hiding, use carefully
20
2.3 Parametric Association
Association mediated by a parameter (function call argument)
A depends upon B, because it uses B
No data member of type B in A
21
2.3 Inheritance
Base class or super class
Derived class or subclass
Arrow shows direction
of dependency
→ B inherits A's interface,
behaviour and data members
→ B can extend A, i.e. add new
data members or member functions
→ B depends on A,
A knows nothing about B
22
2.3 Associations Summary
 Can express different kinds of associations between
classes/objects with UML
 Association, aggregation, composition, inheritance
 Friendship, parametric association
 Can go from simple sketches to more detailed design by adding
adornments
 Name, roles, multiplicities
 lifetime control
23
2.3 Multiple Inheritance
The derived class inherits
interface, behaviour and
data members of all its
base classes
Extension and overriding
works as before
B implements the interface A and
is also a "countable" class
Countable also called a "Mixin class"
24
2.3 Deadly Diamond of Death
Now the @*#! hits the %&$?
Data members of TObject are
inherited twice in B, which ones
are valid?
Fortunately, there is a solution
to this problem:
→ virtual inheritance in C++:
only one copy of a multiply
inherited structure will
be created
(A C++ feature)
25
2.4 Static and Dynamic Design
 Static design describes code structure and object relations
 Class relations
 Objects at a given time
 Dynamic design shows communication between objects
 Similarity to class relations
 can follow sequences of events
26
2.4 Class Diagram
 Show static relations between classes
 we have seen them already
 interfaces, data members
 associations
 Subdivide into diagrams for specific purpose
 showing all classes usually too much
 ok to show only relevant class members
 set of all diagrams should describe system
27
2.4 Object Diagram
Object diagram shows
relations at instant in time
(snapshot)
Object relations are drawn
using the class association
lines
Class diagram
never changes
28
2.4 Sequence Diagram
Show sequence of events for a particular use case
Object
Lifeline
Activation
Messages
half-arrow=asynchronous,
full arrow=synchronous, dashed=return
Active object
29
2.4 Sequence Diagram
Can show creation and
destruction of objects
Destruction mark
30
2.4 Sequence Diagram
Slanted messages take
some time
Can model real-time
systems
31
2.4 Sequence Diagram
Crossing message lines
are a bad sign
→ race conditions
32
2.4 Collaboration Diagram
Object diagram with
numbered messages
Sequence numbers of messages
are nested by procedure call
33
2.4 Static and Dynamic Design
Summary
 Class diagrams → object diagrams
 classes → objects; associations → links
 Dynamic models show how system works
 Sequence and collaboration diagram
 There are tools for this process
 UML syntax and consistency checks
 Rough sketches by hand or with simple tools
 aid in design discussions
34
Some Comments
 Design-heavy development processes
 several 10% of person-power/time spent on design with formal UML
from requirements
 start coding when the design is consistent
 large software houses may work this way
 Lighter processes
 a few % of person-power/time spent with UML
 UML as a discussion and documentation aid
 probably more adequate in HEP
35
36

More Related Content

What's hot

UML Class Diagram G-3-122139
UML Class Diagram G-3-122139UML Class Diagram G-3-122139
UML Class Diagram G-3-122139Hansi Thenuwara
 
The Ultimate Guide for UML Class Diagrams by Creately
The Ultimate Guide for UML Class Diagrams by CreatelyThe Ultimate Guide for UML Class Diagrams by Creately
The Ultimate Guide for UML Class Diagrams by CreatelyCreately
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOADDang Tuan
 
Class diagram presentation
Class diagram presentationClass diagram presentation
Class diagram presentationSayedFarhan110
 
Lecture12 software design class diagram
Lecture12 software design class diagramLecture12 software design class diagram
Lecture12 software design class diagramShahid Riaz
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationshipsPooja mittal
 
UML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework HelpUML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework HelpJacob William
 
UML Class Diagram Notation
UML Class Diagram NotationUML Class Diagram Notation
UML Class Diagram Notationadnan12345678
 
Class diagram
Class diagramClass diagram
Class diagramSESP123
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationmewaseem
 

What's hot (19)

UML Class Diagram G-3-122139
UML Class Diagram G-3-122139UML Class Diagram G-3-122139
UML Class Diagram G-3-122139
 
Software Testing and UML Lab
Software Testing and UML LabSoftware Testing and UML Lab
Software Testing and UML Lab
 
Interfaces & Packages V2
Interfaces & Packages V2Interfaces & Packages V2
Interfaces & Packages V2
 
The Ultimate Guide for UML Class Diagrams by Creately
The Ultimate Guide for UML Class Diagrams by CreatelyThe Ultimate Guide for UML Class Diagrams by Creately
The Ultimate Guide for UML Class Diagrams by Creately
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
 
Class diagram presentation
Class diagram presentationClass diagram presentation
Class diagram presentation
 
Lecture12 software design class diagram
Lecture12 software design class diagramLecture12 software design class diagram
Lecture12 software design class diagram
 
class diagram
class diagramclass diagram
class diagram
 
Class Diagram
Class DiagramClass Diagram
Class Diagram
 
Class diagram
Class diagramClass diagram
Class diagram
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
 
UML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework HelpUML Diagram Assignment Help, UML Diagram Homework Help
UML Diagram Assignment Help, UML Diagram Homework Help
 
2 class use case
2 class use case2 class use case
2 class use case
 
UML Class Diagram Notation
UML Class Diagram NotationUML Class Diagram Notation
UML Class Diagram Notation
 
Class diagram
Class diagramClass diagram
Class diagram
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Types of UML diagrams
Types of UML diagramsTypes of UML diagrams
Types of UML diagrams
 

Similar to Basics of uml

Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxCh.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxSohagSrz
 
UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling LanguageShahzad
 
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPTCS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPTleela rani
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLMalek Sumaiya
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 
CS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT IICS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT IIpkaviya
 
Introduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfIntroduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfTARGARYEN001
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented DesignAravinth NSP
 
Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Umlguest514814
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationanasz3z3
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural ModelingAMITJain879
 
SDA ClassDiagram.ppt
SDA ClassDiagram.pptSDA ClassDiagram.ppt
SDA ClassDiagram.pptAteeqaKokab1
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manualPraseela R
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
 

Similar to Basics of uml (20)

Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxCh.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling Language
 
Css uml
Css umlCss uml
Css uml
 
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPTCS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
CS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT IICS8592 Object Oriented Analysis & Design - UNIT II
CS8592 Object Oriented Analysis & Design - UNIT II
 
Introduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfIntroduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdf
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Unit 2
Unit 2Unit 2
Unit 2
 
Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Uml
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
SDA ClassDiagram.ppt
SDA ClassDiagram.pptSDA ClassDiagram.ppt
SDA ClassDiagram.ppt
 
Sda 7
Sda   7Sda   7
Sda 7
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 

More from Naga Muruga

CHAITANYA UNIVERSITY - BEST POSTER.pdf
CHAITANYA UNIVERSITY - BEST POSTER.pdfCHAITANYA UNIVERSITY - BEST POSTER.pdf
CHAITANYA UNIVERSITY - BEST POSTER.pdfNaga Muruga
 
AMET - BEST PRESENTATION.pdf
AMET - BEST PRESENTATION.pdfAMET - BEST PRESENTATION.pdf
AMET - BEST PRESENTATION.pdfNaga Muruga
 
DEvOpS, CI/CD For Beginners.pdf
DEvOpS, CI/CD For Beginners.pdfDEvOpS, CI/CD For Beginners.pdf
DEvOpS, CI/CD For Beginners.pdfNaga Muruga
 
API and Web Service Introduction .pdf
API and Web Service Introduction .pdfAPI and Web Service Introduction .pdf
API and Web Service Introduction .pdfNaga Muruga
 
Naga muruga resume
Naga muruga resumeNaga muruga resume
Naga muruga resumeNaga Muruga
 
Self Healing Materials - A Review
Self Healing Materials - A ReviewSelf Healing Materials - A Review
Self Healing Materials - A ReviewNaga Muruga
 
Fundamentals of Manuscript Preparation
Fundamentals of Manuscript PreparationFundamentals of Manuscript Preparation
Fundamentals of Manuscript PreparationNaga Muruga
 
Auto CAD (Beginner)
Auto CAD (Beginner)Auto CAD (Beginner)
Auto CAD (Beginner)Naga Muruga
 
Boilers, Types and Energy Efficiency
Boilers, Types and Energy EfficiencyBoilers, Types and Energy Efficiency
Boilers, Types and Energy EfficiencyNaga Muruga
 
Project Management Essentials
Project Management EssentialsProject Management Essentials
Project Management EssentialsNaga Muruga
 
Lean Six Sigma White Belt
Lean Six Sigma White BeltLean Six Sigma White Belt
Lean Six Sigma White BeltNaga Muruga
 
Basics of Drives and Motors
Basics of Drives and MotorsBasics of Drives and Motors
Basics of Drives and MotorsNaga Muruga
 
Anti juice jacking smart solar charger
Anti juice jacking smart solar chargerAnti juice jacking smart solar charger
Anti juice jacking smart solar chargerNaga Muruga
 
Top 32 technologies
Top 32 technologiesTop 32 technologies
Top 32 technologiesNaga Muruga
 
Controversy on feminism
Controversy on feminismControversy on feminism
Controversy on feminismNaga Muruga
 

More from Naga Muruga (20)

CHAITANYA UNIVERSITY - BEST POSTER.pdf
CHAITANYA UNIVERSITY - BEST POSTER.pdfCHAITANYA UNIVERSITY - BEST POSTER.pdf
CHAITANYA UNIVERSITY - BEST POSTER.pdf
 
AMET - BEST PRESENTATION.pdf
AMET - BEST PRESENTATION.pdfAMET - BEST PRESENTATION.pdf
AMET - BEST PRESENTATION.pdf
 
Intro to Git
Intro to GitIntro to Git
Intro to Git
 
DEvOpS, CI/CD For Beginners.pdf
DEvOpS, CI/CD For Beginners.pdfDEvOpS, CI/CD For Beginners.pdf
DEvOpS, CI/CD For Beginners.pdf
 
API and Web Service Introduction .pdf
API and Web Service Introduction .pdfAPI and Web Service Introduction .pdf
API and Web Service Introduction .pdf
 
Naga muruga resume
Naga muruga resumeNaga muruga resume
Naga muruga resume
 
Self Healing Materials - A Review
Self Healing Materials - A ReviewSelf Healing Materials - A Review
Self Healing Materials - A Review
 
Fundamentals of Manuscript Preparation
Fundamentals of Manuscript PreparationFundamentals of Manuscript Preparation
Fundamentals of Manuscript Preparation
 
Auto CAD (Beginner)
Auto CAD (Beginner)Auto CAD (Beginner)
Auto CAD (Beginner)
 
Content Writing
Content WritingContent Writing
Content Writing
 
Boilers, Types and Energy Efficiency
Boilers, Types and Energy EfficiencyBoilers, Types and Energy Efficiency
Boilers, Types and Energy Efficiency
 
Project Management Essentials
Project Management EssentialsProject Management Essentials
Project Management Essentials
 
Lean Six Sigma White Belt
Lean Six Sigma White BeltLean Six Sigma White Belt
Lean Six Sigma White Belt
 
Basics of Drives and Motors
Basics of Drives and MotorsBasics of Drives and Motors
Basics of Drives and Motors
 
Supply Chain
Supply ChainSupply Chain
Supply Chain
 
Green walls
Green wallsGreen walls
Green walls
 
Anti juice jacking smart solar charger
Anti juice jacking smart solar chargerAnti juice jacking smart solar charger
Anti juice jacking smart solar charger
 
Top 32 technologies
Top 32 technologiesTop 32 technologies
Top 32 technologies
 
Controversy on feminism
Controversy on feminismControversy on feminism
Controversy on feminism
 
Unicef poster
Unicef posterUnicef poster
Unicef poster
 

Recently uploaded

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Recently uploaded (20)

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 

Basics of uml

  • 1. 1 Introduction to Unified Modeling Language By, D. B. Naga Muruga, Dept of Mechanical Engineering, Sriram Engineering College
  • 2. 2 UML for OOAD 2.1 What is UML? 2.2 Classes in UML 2.3 Relations in UML 2.4 Static and Dynamic Design with UML
  • 3. 3 2.1 UML Background "The Unified Modelling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system. The UML offers a standard way to write a systems blueprints, including conceptual things like business processes and system functions as well as concrete things such as programming language statements, database schemas, and reusable software components." Grady Booch, Ivar Jacobsen, Jim Rumbaugh Rational Software [OMG Unified Modelling Language Specification, Version 1.3, March 2000]
  • 4. 4 2.1 Brief UML History  Around 1980  first OO modelling languages  other techniques, e.g. SA/SD  Around 1990  "OO method wars"  many modelling languages  End of 90's  UML appears as combination of best practices
  • 5. 5 2.1 Why UML?  Physicists know formal graphical modelling  Mathematics to describe nature  Feynman graphs to calculate particle reaction rates  We need a common language  discuss software systems at a black- (white-) board  document software systems  UML is an important part of that language  UML provides the "words and grammar"
  • 6. 6 2.2 Classes in UML  Classes describe objects  Interface (member function signature)  Behaviour (member function implementation)  State bookkeeping (values of data members)  Creation and destruction  Objects described by classes collaborate  Class relations → object relations  Dependencies between classes
  • 7. 7 2.2 UML Class Class name Data members Instance methods Arguments Return types Data members, arguments and methods are specified by visibility name : type Class method
  • 8. 8 2.2 Class Name The top compartment contains the class name Abstract classes have italicised names Abstract methods also have italicised names Stereotypes are used to identify groups of classes, e.g interfaces or persistent (storeable) classes
  • 9. 9 2.2 Class Attributes Attributes are the instance and class data members Class data members (underlined) are shared between all instances (objects) of a given class Data types shown after ":" Visibility shown as + public - private # protected Attribute compartment visibility name : type
  • 10. 10 2.2 Class Operations (Interface) Operations are the class methods with their argument and return types Public (+) operations define the class interface Class methods (underlined) have only access to class data members, no need for a class instance (object) Operations compartment visibility name : type
  • 11. 11 2.2 Visibility + public Anyone can access Interface operations Not data members - private No-one can access Data members Helper functions "Friends" are allowd in though # protected Subclasses can access Operations where sub- classes collaborate Not data members (creates dependency off subclass on im- plementation of parent)
  • 12. 12 2.2 Template Classes Generic classes depending on parametrised types Type parameter(s) Operations compartment as usual, but may have type parameter instead of concrete type
  • 13. 13 2.3 Relations  Association  Aggregation  Composition  Parametric and Friendship  Inheritance
  • 14. 14 2.3 Binary Association Binary association: both classes know each other Usually "knows about" means a pointer or reference Other methods possible: method argument, tables, database, ... Implies dependency cycle
  • 15. 15 2.3 Unary Association A knows about B, but B knows nothing about A Arrow shows direction of association in direction of dependency
  • 16. 16 2.3 Aggregation Aggregation = Association with "whole-part" relationship Shown by hollow diamond at the "whole" side No lifetime control implied
  • 17. 17 2.3 Composition Composition = Aggregation with lifetime control Shown by filled diamond at the "owner" side Lifetime control implied Lifetime control can be tranferred Lifetime control: construction and destruction controlled by "owner" → call constructors and destructors (or have somebody else do it)
  • 18. 18 2.3 Association Details Name gives details of association Name can be viewed as verb of a sentence Notes at association ends explain "roles" of classes (objects) Multiplicities show number of objects which participate in the association
  • 19. 19 2.3 Friendship Friends are granted access to private data members and member functions Friendship is given to other classes, never taken Bob Martin: More like lovers than friends. You can have many friends, you should not have many lovers Friendship breaks data hiding, use carefully
  • 20. 20 2.3 Parametric Association Association mediated by a parameter (function call argument) A depends upon B, because it uses B No data member of type B in A
  • 21. 21 2.3 Inheritance Base class or super class Derived class or subclass Arrow shows direction of dependency → B inherits A's interface, behaviour and data members → B can extend A, i.e. add new data members or member functions → B depends on A, A knows nothing about B
  • 22. 22 2.3 Associations Summary  Can express different kinds of associations between classes/objects with UML  Association, aggregation, composition, inheritance  Friendship, parametric association  Can go from simple sketches to more detailed design by adding adornments  Name, roles, multiplicities  lifetime control
  • 23. 23 2.3 Multiple Inheritance The derived class inherits interface, behaviour and data members of all its base classes Extension and overriding works as before B implements the interface A and is also a "countable" class Countable also called a "Mixin class"
  • 24. 24 2.3 Deadly Diamond of Death Now the @*#! hits the %&$? Data members of TObject are inherited twice in B, which ones are valid? Fortunately, there is a solution to this problem: → virtual inheritance in C++: only one copy of a multiply inherited structure will be created (A C++ feature)
  • 25. 25 2.4 Static and Dynamic Design  Static design describes code structure and object relations  Class relations  Objects at a given time  Dynamic design shows communication between objects  Similarity to class relations  can follow sequences of events
  • 26. 26 2.4 Class Diagram  Show static relations between classes  we have seen them already  interfaces, data members  associations  Subdivide into diagrams for specific purpose  showing all classes usually too much  ok to show only relevant class members  set of all diagrams should describe system
  • 27. 27 2.4 Object Diagram Object diagram shows relations at instant in time (snapshot) Object relations are drawn using the class association lines Class diagram never changes
  • 28. 28 2.4 Sequence Diagram Show sequence of events for a particular use case Object Lifeline Activation Messages half-arrow=asynchronous, full arrow=synchronous, dashed=return Active object
  • 29. 29 2.4 Sequence Diagram Can show creation and destruction of objects Destruction mark
  • 30. 30 2.4 Sequence Diagram Slanted messages take some time Can model real-time systems
  • 31. 31 2.4 Sequence Diagram Crossing message lines are a bad sign → race conditions
  • 32. 32 2.4 Collaboration Diagram Object diagram with numbered messages Sequence numbers of messages are nested by procedure call
  • 33. 33 2.4 Static and Dynamic Design Summary  Class diagrams → object diagrams  classes → objects; associations → links  Dynamic models show how system works  Sequence and collaboration diagram  There are tools for this process  UML syntax and consistency checks  Rough sketches by hand or with simple tools  aid in design discussions
  • 34. 34 Some Comments  Design-heavy development processes  several 10% of person-power/time spent on design with formal UML from requirements  start coding when the design is consistent  large software houses may work this way  Lighter processes  a few % of person-power/time spent with UML  UML as a discussion and documentation aid  probably more adequate in HEP
  • 35. 35
  • 36. 36