Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Simple UML             May 12, 2012
What is UML?   UML stands for Unified Modeling Language   UML is a diagramming language designed for Object-    Oriented...
Design Patterns   Design Patterns describe the higher-level organization    of solutions to common problems   Design Pat...
UML is complex   UML is a big, complicated diagramming language   UML comprises at least seven or eight different kinds ...
Class diagrams   A class diagram shows classes, interfaces, and their    relationships   We’ll cover most of classes and...
Classes   A class is drawn as a rectangle with two or three    compartments:                     Name of the class       ...
Variables I   A variable is written as:                   visibility name : type    where:       + means public visibili...
Variables II   Static variables are underlined   An initial value can be shown with =value   Example:       -numberOfEm...
Methods   Methods are written as:      visibility name (parameters) : returnType    where       visibility uses the same...
Example of a class  Card  cardId:int  -copy:boolean=false  «constructor» Card(int id)  +isKind(desiredKind:int)  +isSharab...
Types of relationships A            C             Factory                                 creates                  1..4 B ...
Example: Secret Code program                               12
UML tools   Rational Rose is the “real world” standard; full round-    trip code generation       Recently acquired by I...
Tool links   Rational Rose       http://www-3.ibm.com/software/awdtools/developer/rosexde/   Together       http://www...
The End          15
Upcoming SlideShare
Loading in …5
×

31 uml

423 views

Published on

uml

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

31 uml

  1. 1. Simple UML May 12, 2012
  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 2
  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 may discuss some Design Patterns later on in this course 3
  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 4
  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 5
  6. 6. Classes A class is drawn as a rectangle with two or three compartments: Name of the class Variables [optional] Methods 6
  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 7
  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 8
  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 9
  10. 10. Example of a class Card cardId:int -copy:boolean=false «constructor» Card(int id) +isKind(desiredKind:int) +isSharable():boolean +toString():String 10
  11. 11. Types of relationships A C Factory creates 1..4 B D ProductClass B Class C Otherextends contains kinds ofclass A 1 to 4 objects relations of class D 11
  12. 12. Example: Secret Code program 12
  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 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. 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. 15. The End 15

×