1 / 18

Simple UML

Simple UML. What is UML?. 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. Design Patterns.

chase
Télécharger la présentation

Simple UML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simple UML

  2. What is UML? • 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 • They are a current hot topic in O-O design • UML is always used for Design Patterns • 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

  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. Name of the class Variables [optional] Methods Classes • A class is drawn as a rectangle with two or three compartments:

  7. Variables I • A variable is written as:visibility name : typewhere: • + 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=10means numberOfEmployees is: • private, static, integer, with initial value 10

  9. Methods • Methods are written as:visibility name (parameters) : returnTypewhere • visibility is the same as variables (+, -, #, blank) • parameters are given as name:type • if the returnType is void, it is omitted • constructors are preceded by «constructor» • an ellipsis (…) indicates omitted methods

  10. Card cardId:int -copy:boolean=false «constructor» Card(int id) +isKind(desiredKind:int) +isSharable():boolean +toString():String Example of a class

  11. A B C D Factory Product creates 1..4 Types of relationships Class Bextendsclass A Class Ccontains 1 to 4 objectsof class D Other kinds ofrelations

  12. Example: Secret Code program

  13. UML tools • Visio is a Microsoft tool for drawing UML diagrams • Dia is a freeware clone of Visio • Rational Rose is the "real world" standard; full round-trip code generation • Together (from TogetherSoft) appears to be a lot like Rational Rose

  14. Tool availability • Visio: you can order a 60-day trial CD, but you can't just download a copy • Dia: Free, downloadable, but tricky to install and of unknown quality • Rational Rose: 233 MB, expires in 15 days • Together: 23 MB free download after filling out a form (basic version doesn't expire; fancy features expire in 30 days)

  15. Tool links • Visio • http://www.microsoft.com/office/visio/ • Dia • http://www.lysator.liu.se/~alla/dia/dia.html • Rational Rose • http://www.rational.com/products/rose/index.jsp • Together • http://www.togethersoft.com/

  16. Schedule for today • This UML talk • Brief introduction to WebCT • Work on your game design • Peer reviews of game designs

  17. Assignments • Next Monday: • Finish designing your game • I want two informal designs: • A design for the absolutely minimal playable game • A design for the complete game • Next Wednesday: • Formal design of the minimal game • preferably in UML (or something close to UML) • Hand-drawn diagrams are fine

  18. The End

More Related