SlideShare a Scribd company logo
Jan 27, 2016
Simple UML
R.M.Alagunila
2
What is UML?
 UML stands for Unified Modeling Language
 UML is a diagramming language designed for Object-
Oriented programming
 UML can be used to describe:
 the organization of a program
 how a program executes
 how a program is used
 how a program is deployed over a network
 …and more
3
Design Patterns
 Design Patterns describe the higher-level organization
of solutions to common problems
 Design Patterns are a current hot topic in O-O design
 UML is always used for Design Patterns
 Design Patterns are used to describe refactorings
 We will discuss some Design Patterns later on in this
course
4
UML is complex
 UML is a big, complicated diagramming language
 UML comprises at least seven or eight different kinds
of diagrams
 This talk will cover just a tiny bit of one kind of
diagram, the class diagram
 A class diagram is often all that is needed to describe
a particular Design Pattern
5
Class diagrams
 A class diagram shows classes, interfaces, and their
relationships
 We’ll cover most of classes and interfaces, and a few
of the most important relationships
6
Classes
 A class is drawn as a rectangle with two or three
compartments:
Name of the class
Variables [optional]
Methods
7
Variables I
 A variable is written as:
visibility name : type
where:
 + means public visibility
 # means protected visibility
 - means private visibility
 <blank> means default (package) visibility
 Example: +length:int
8
Variables II
 Static variables are underlined
 An initial value can be shown with =value
 Example:
-numberOfEmployees:int=10
means numberOfEmployees is:
 private
 static
 integer
 and has 10 as its initial value
9
Methods
 Methods are written as:
visibility name (parameters) : returnType
where
 visibility uses the same syntax variables (+, -, #, blank)
 parameters are given as name:type
 if the returnType is void, it is omitted
 constructors are preceded by «constructor»
 interfaces are preceded by «interface»
 an ellipsis (…) indicates omitted methods
10
Example of a class
Card
cardId:int
-copy:boolean=false
«constructor» Card(int id)
+isKind(desiredKind:int)
+isSharable():boolean
+toString():String
11
Types of relationships
A
B
Class B
extends
class A
C
D
1..4
Class C
contains
1 to 4 objects
of class D
Factory
Product
creates
Other
kinds of
relations
12
Example: Secret Code program
13
UML tools
 Rational Rose is the “real world” standard; full round-
trip code generation
 Recently acquired by IBM (right under Microsoft’s nose!)
 Together (from Borland) is a lot like Rational Rose
 I haven’t used it in about three years (since before Borland
bought it from TogetherSoft)
 ArgoUML looks interesting (and is open source)
 BlueJ, of course, displays simple UML diagrams
 Drawing programs with UML support
 Visio is a Microsoft tool
 Dia is a freeware clone of Visio
14
Tool links
 Rational Rose
 http://www-3.ibm.com/software/awdtools/developer/rosexde/
 Together
 http://www.borland.com/together/
 ArgoUML
 http://argouml.tigris.org
 Visio
 Hard to find info on Microsoft’s site!
 http://msdn.microsoft.com/office/understanding/visio/
 Dia
 http://www.lysator.liu.se/~alla/dia
15
The End
Ad

More Related Content

What's hot (20)

constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
Mahender Boda
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
Way2itech
 
Data types
Data typesData types
Data types
Nokesh Prabhakar
 
Session02 c intro
Session02 c introSession02 c intro
Session02 c intro
HarithaRanasinghe
 
Lec4slides
Lec4slidesLec4slides
Lec4slides
shawiz
 
Basic Programming of c++
Basic Programming of c++Basic Programming of c++
Basic Programming of c++
MMAbdullah17
 
Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text] Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text]
Neven El Said Bfci
 
introductory concepts
introductory conceptsintroductory concepts
introductory concepts
Walepak Ubi
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 
Data Types
Data TypesData Types
Data Types
Nicole Ynne Estabillo
 
C programming Tutorial Session 1
C programming Tutorial Session 1C programming Tutorial Session 1
C programming Tutorial Session 1
Muhammad Ehtisham Siddiqui
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 
C#
C#C#
C#
Sudhriti Gupta
 
C# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data TypesC# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data Types
Micheal Ogundero
 
Elements of functional programming
Elements of functional programmingElements of functional programming
Elements of functional programming
Sajjad Ali Pulikkanat
 
Ppl home assignment_unit2
Ppl home assignment_unit2Ppl home assignment_unit2
Ppl home assignment_unit2
Akshay Nagpurkar
 
SEMINAR
SEMINARSEMINAR
SEMINAR
priteshkhandelwal
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
Md. Mahedee Hasan
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
Way2itech
 
Lec4slides
Lec4slidesLec4slides
Lec4slides
shawiz
 
Basic Programming of c++
Basic Programming of c++Basic Programming of c++
Basic Programming of c++
MMAbdullah17
 
Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text] Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text]
Neven El Said Bfci
 
introductory concepts
introductory conceptsintroductory concepts
introductory concepts
Walepak Ubi
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 
C# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data TypesC# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data Types
Micheal Ogundero
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 

Similar to Simple uml (20)

Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
Mubashir Jutt
 
SDA ClassDiagram.ppt
SDA ClassDiagram.pptSDA ClassDiagram.ppt
SDA ClassDiagram.ppt
AteeqaKokab1
 
Week 10-classdiagrams.pptdddddddddddddddddddddddddddd
Week 10-classdiagrams.pptddddddddddddddddddddddddddddWeek 10-classdiagrams.pptdddddddddddddddddddddddddddd
Week 10-classdiagrams.pptdddddddddddddddddddddddddddd
v67904413
 
Introduction to UML, class diagrams, sequence diagrams
Introduction to UML, class diagrams, sequence diagramsIntroduction to UML, class diagrams, sequence diagrams
Introduction to UML, class diagrams, sequence diagrams
Dr. Jasmine Beulah Gnanadurai
 
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
Malek Sumaiya
 
UML (Hemant rajak)
UML (Hemant rajak)UML (Hemant rajak)
UML (Hemant rajak)
hrajak5
 
l1_introuml.pdf
l1_introuml.pdfl1_introuml.pdf
l1_introuml.pdf
KalsoomTahir2
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
Debajyoti Biswas
 
EXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGE
EXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGEEXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGE
EXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGE
ijait
 
Exact implementation of design patterns in
Exact implementation of design patterns inExact implementation of design patterns in
Exact implementation of design patterns in
ijait
 
IntroductionToUML.ppt
IntroductionToUML.pptIntroductionToUML.ppt
IntroductionToUML.ppt
ssuser1028f8
 
Uml introduciton
Uml introducitonUml introduciton
Uml introduciton
Dr. C.V. Suresh Babu
 
ooAD
ooADooAD
ooAD
manjulakithsiri
 
UML Basics
UML BasicsUML Basics
UML Basics
Serdar Temiz
 
UML Overview and Introduction functions.pdf
UML Overview and Introduction functions.pdfUML Overview and Introduction functions.pdf
UML Overview and Introduction functions.pdf
prathipaceec
 
Uml lecture
Uml lectureUml lecture
Uml lecture
Inocentshuja Ahmad
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
Madhar Khan Pathan
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
anasz3z3
 
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejeUML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
ssusera6a60c1
 
Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Uml
guest514814
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
Mubashir Jutt
 
SDA ClassDiagram.ppt
SDA ClassDiagram.pptSDA ClassDiagram.ppt
SDA ClassDiagram.ppt
AteeqaKokab1
 
Week 10-classdiagrams.pptdddddddddddddddddddddddddddd
Week 10-classdiagrams.pptddddddddddddddddddddddddddddWeek 10-classdiagrams.pptdddddddddddddddddddddddddddd
Week 10-classdiagrams.pptdddddddddddddddddddddddddddd
v67904413
 
Introduction to UML, class diagrams, sequence diagrams
Introduction to UML, class diagrams, sequence diagramsIntroduction to UML, class diagrams, sequence diagrams
Introduction to UML, class diagrams, sequence diagrams
Dr. Jasmine Beulah Gnanadurai
 
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
Malek Sumaiya
 
UML (Hemant rajak)
UML (Hemant rajak)UML (Hemant rajak)
UML (Hemant rajak)
hrajak5
 
EXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGE
EXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGEEXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGE
EXACT IMPLEMENTATION OF DESIGN PATTERNS IN C# LANGUAGE
ijait
 
Exact implementation of design patterns in
Exact implementation of design patterns inExact implementation of design patterns in
Exact implementation of design patterns in
ijait
 
IntroductionToUML.ppt
IntroductionToUML.pptIntroductionToUML.ppt
IntroductionToUML.ppt
ssuser1028f8
 
UML Overview and Introduction functions.pdf
UML Overview and Introduction functions.pdfUML Overview and Introduction functions.pdf
UML Overview and Introduction functions.pdf
prathipaceec
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
Madhar Khan Pathan
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
anasz3z3
 
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejeUML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
ssusera6a60c1
 
Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Uml
guest514814
 
Ad

Recently uploaded (20)

SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Ad

Simple uml

  • 1. Jan 27, 2016 Simple UML R.M.Alagunila
  • 2. 2 What is UML?  UML stands for Unified Modeling Language  UML is a diagramming language designed for Object- Oriented programming  UML can be used to describe:  the organization of a program  how a program executes  how a program is used  how a program is deployed over a network  …and more
  • 3. 3 Design Patterns  Design Patterns describe the higher-level organization of solutions to common problems  Design Patterns are a current hot topic in O-O design  UML is always used for Design Patterns  Design Patterns are used to describe refactorings  We will discuss some Design Patterns later on in this course
  • 4. 4 UML is complex  UML is a big, complicated diagramming language  UML comprises at least seven or eight different kinds of diagrams  This talk will cover just a tiny bit of one kind of diagram, the class diagram  A class diagram is often all that is needed to describe a particular Design Pattern
  • 5. 5 Class diagrams  A class diagram shows classes, interfaces, and their relationships  We’ll cover most of classes and interfaces, and a few of the most important relationships
  • 6. 6 Classes  A class is drawn as a rectangle with two or three compartments: Name of the class Variables [optional] Methods
  • 7. 7 Variables I  A variable is written as: visibility name : type where:  + means public visibility  # means protected visibility  - means private visibility  <blank> means default (package) visibility  Example: +length:int
  • 8. 8 Variables II  Static variables are underlined  An initial value can be shown with =value  Example: -numberOfEmployees:int=10 means numberOfEmployees is:  private  static  integer  and has 10 as its initial value
  • 9. 9 Methods  Methods are written as: visibility name (parameters) : returnType where  visibility uses the same syntax variables (+, -, #, blank)  parameters are given as name:type  if the returnType is void, it is omitted  constructors are preceded by «constructor»  interfaces are preceded by «interface»  an ellipsis (…) indicates omitted methods
  • 10. 10 Example of a class Card cardId:int -copy:boolean=false «constructor» Card(int id) +isKind(desiredKind:int) +isSharable():boolean +toString():String
  • 11. 11 Types of relationships A B Class B extends class A C D 1..4 Class C contains 1 to 4 objects of class D Factory Product creates Other kinds of relations
  • 13. 13 UML tools  Rational Rose is the “real world” standard; full round- trip code generation  Recently acquired by IBM (right under Microsoft’s nose!)  Together (from Borland) is a lot like Rational Rose  I haven’t used it in about three years (since before Borland bought it from TogetherSoft)  ArgoUML looks interesting (and is open source)  BlueJ, of course, displays simple UML diagrams  Drawing programs with UML support  Visio is a Microsoft tool  Dia is a freeware clone of Visio
  • 14. 14 Tool links  Rational Rose  http://www-3.ibm.com/software/awdtools/developer/rosexde/  Together  http://www.borland.com/together/  ArgoUML  http://argouml.tigris.org  Visio  Hard to find info on Microsoft’s site!  http://msdn.microsoft.com/office/understanding/visio/  Dia  http://www.lysator.liu.se/~alla/dia