SlideShare une entreprise Scribd logo
1  sur  15
Simple UML




             May 12, 2012
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



                                                         2
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 may discuss some Design Patterns later on in this
    course




                                                             3
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




                                                              4
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




                                                            5
Classes
   A class is drawn as a rectangle with two or three
    compartments:


                     Name of the class

                     Variables [optional]


                          Methods




                                                        6
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




                                                     7
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


                                                8
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



                                                                     9
Example of a class


  Card

  cardId:int
  -copy:boolean=false

  «constructor» Card(int id)
  +isKind(desiredKind:int)
  +isSharable():boolean
  +toString():String


                               10
Types of relationships

 A            C             Factory

                                 creates
                  1..4
 B            D             Product


Class B       Class C        Other
extends      contains      kinds of
class A   1 to 4 objects   relations
            of class D
                                           11
Example: Secret Code program




                               12
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 five 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

                                                                      13
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
       hhttp://www.gnome.org/projects/dia/
   OmniGraffle 3 (Mac OS X)
       http://www.omnigroup.com/applications/omnigraffle/
                                                                    14
The End




          15

Contenu connexe

Tendances

Literals,variables,datatype in C#
Literals,variables,datatype in C#Literals,variables,datatype in C#
Literals,variables,datatype in C#Prasanna Kumar SM
 
C# Summer course - Lecture 2
C# Summer course - Lecture 2C# Summer course - Lecture 2
C# Summer course - Lecture 2mohamedsamyali
 
Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text] Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text] Neven El Said Bfci
 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling languageamity2j
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++Ameer Khan
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ LanguageWay2itech
 
Abstract & Interface
Abstract & InterfaceAbstract & Interface
Abstract & InterfaceLinh Lê
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programmingRumman Ansari
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesDurgesh Singh
 
C++
C++C++
C++k v
 
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 constantsvinay arora
 
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 ProgrammingKamal Acharya
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introductionnikshaikh786
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data typesPratik Devmurari
 
Module 5-Structure and Union
Module 5-Structure and UnionModule 5-Structure and Union
Module 5-Structure and Unionnikshaikh786
 

Tendances (19)

Literals,variables,datatype in C#
Literals,variables,datatype in C#Literals,variables,datatype in C#
Literals,variables,datatype in C#
 
C# Summer course - Lecture 2
C# Summer course - Lecture 2C# Summer course - Lecture 2
C# Summer course - Lecture 2
 
Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text] Multimedia Lab Handout [Lab2] [Text]
Multimedia Lab Handout [Lab2] [Text]
 
Methods in C#
Methods in C#Methods in C#
Methods in C#
 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling language
 
Data types
Data typesData types
Data types
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Abstract & Interface
Abstract & InterfaceAbstract & Interface
Abstract & Interface
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
 
Structures in c++
Structures in c++Structures in c++
Structures in c++
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
 
C++
C++C++
C++
 
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
 
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
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introduction
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
 
Module 5-Structure and Union
Module 5-Structure and UnionModule 5-Structure and Union
Module 5-Structure and Union
 

Similaire à 31 uml

Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineeringMubashir Jutt
 
SDA ClassDiagram.ppt
SDA ClassDiagram.pptSDA ClassDiagram.ppt
SDA ClassDiagram.pptAteeqaKokab1
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 
香港六合彩 &raquo; SlideShare
香港六合彩 &raquo; SlideShare香港六合彩 &raquo; SlideShare
香港六合彩 &raquo; SlideSharebiyu
 
Oops concepts in c++ documentation
Oops concepts in c++ documentationOops concepts in c++ documentation
Oops concepts in c++ documentationfarouq umar
 
Promoting Polymorphism
Promoting PolymorphismPromoting Polymorphism
Promoting PolymorphismKevlin Henney
 
Exact implementation of design patterns in
Exact implementation of design patterns inExact implementation of design patterns in
Exact implementation of design patterns inijait
 
20 Object-oriented programming principles
20 Object-oriented programming principles20 Object-oriented programming principles
20 Object-oriented programming principlesmaznabili
 
UML Case Tools
UML Case ToolsUML Case Tools
UML Case ToolsAshesh R
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages mohamed drahem
 
Uml classdiagrams
Uml classdiagramsUml classdiagrams
Uml classdiagramsWahid Zaman
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.pptTigistTilahun1
 

Similaire à 31 uml (20)

Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
SDA ClassDiagram.ppt
SDA ClassDiagram.pptSDA ClassDiagram.ppt
SDA ClassDiagram.ppt
 
Tutorial csharp
Tutorial csharpTutorial csharp
Tutorial csharp
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
香港六合彩 &raquo; SlideShare
香港六合彩 &raquo; SlideShare香港六合彩 &raquo; SlideShare
香港六合彩 &raquo; SlideShare
 
Oops concepts in c++ documentation
Oops concepts in c++ documentationOops concepts in c++ documentation
Oops concepts in c++ documentation
 
Week1
Week1Week1
Week1
 
COM Introduction
COM IntroductionCOM Introduction
COM Introduction
 
Promoting Polymorphism
Promoting PolymorphismPromoting Polymorphism
Promoting Polymorphism
 
Exact implementation of design patterns in
Exact implementation of design patterns inExact implementation of design patterns in
Exact implementation of design patterns in
 
Oo ps exam answer2
Oo ps exam answer2Oo ps exam answer2
Oo ps exam answer2
 
20 Object-oriented programming principles
20 Object-oriented programming principles20 Object-oriented programming principles
20 Object-oriented programming principles
 
UML Case Tools
UML Case ToolsUML Case Tools
UML Case Tools
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
C sharp
C sharpC sharp
C sharp
 
Uml classdiagrams
Uml classdiagramsUml classdiagrams
Uml classdiagrams
 
Uml lecture
Uml lectureUml lecture
Uml lecture
 
UML Basics
UML BasicsUML Basics
UML Basics
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 

Dernier

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 

Dernier (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

31 uml

  • 1. Simple UML May 12, 2012
  • 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 2
  • 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 may discuss some Design Patterns later on in this course 3
  • 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 4
  • 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 5
  • 6. Classes  A class is drawn as a rectangle with two or three compartments: Name of the class Variables [optional] Methods 6
  • 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 7
  • 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 8
  • 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 9
  • 10. Example of a class Card cardId:int -copy:boolean=false «constructor» Card(int id) +isKind(desiredKind:int) +isSharable():boolean +toString():String 10
  • 11. Types of relationships A C Factory creates 1..4 B D Product Class B Class C Other extends contains kinds of class A 1 to 4 objects relations of class D 11
  • 12. Example: Secret Code program 12
  • 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 five 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 13
  • 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  hhttp://www.gnome.org/projects/dia/  OmniGraffle 3 (Mac OS X)  http://www.omnigroup.com/applications/omnigraffle/ 14
  • 15. The End 15