• Save
Introduction to UML
Upcoming SlideShare
Loading in...5
×
 

Introduction to UML

on

  • 2,433 views

An introduction to understanding and using UML for object-oriented design.

An introduction to understanding and using UML for object-oriented design.

Statistics

Views

Total Views
2,433
Views on SlideShare
1,764
Embed Views
669

Actions

Likes
2
Downloads
0
Comments
0

6 Embeds 669

http://www.loufranco.com 342
http://loufranco.com 305
http://feeds.loufranco.com 9
http://bb.haw-aw.de 8
http://new.loufranco.com 4
http://translate.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • UML is used to model OO design, but what is design? <br />
  • First there are problems, and problems have many solutions. Each solution has its own trade-offs between benefits and drawbacks. <br />
  • Design is choosing the combination of tradeoffs that best solves our problem <br />
  • <br />
  • 1. Faster to model than to implement <br /> 2. Helps us choose <br /> 3. Try different approaches (to compare) <br /> 4. Finish the most promising ones <br />
  • 1. Communicate to yourself <br /> 2. Communicate to implementors <br /> 3. Communicate to domain experts <br />
  • 1. Models show the important choices <br /> 2. Leave out details to emphasize <br /> 3. Several different views on same structure <br />
  • UNIFIED MODELING LANGUAGE <br /> Unifies: Booch, Rumbaugh, Jacobson <br /> Language: Can be used to implement a software system -- equivalent to code <br /> omg (uml.org) &#x201C;A specification defining a graphical language for visualizing, specifying, constructing, and documenting the artifacts of distributed object systems.&#xA0;&#x201C; <br /> Unifies 50+ OO modeling systems <br />
  • Main point <br />
  • <br />
  • <br />
  • Class name could be just the Name or Package::Name <br /> attribute spec is <br /> attribute:Type[multiplicity] = default value <br /> <br /> operation spec is <br /> operation : (arg: ArgType, arg2: Arg2Type=default) : Type <br /> <br /> <br />
  • 1. Everything is optional (name could be class name) <br /> 2. Multiplicity <br /> 3. Bidirectional <br />
  • Top is an association class, where each pairing of Library and Member is represented in a Membership class <br /> Bottom is a qualified association where Library has a map of id to Lendable. The Multiplicity is per id. <br /> <br /> Don&#x2019;t show datastructures, unless ... <br />
  • call, create, permit (friend), use <br />
  • The word generalization emphasizes the role of the base class. Don&#x2019;t think is-a -- think substitutability. <br />
  • Top one emphasizes that Clipboard uses an interface and DataObject is just one of those <br /> Bottom one emphasizes that DataObject provides an interface and Clipboard is a class that would use it <br />
  • Only time to show datastructures is if that&#x2019;s specifically what you&#x2019;re monitoring <br />
  • <br />
  • Objects are underlined, either the object name or the class name is optional. If just showing class, keep the colon. The lifeline is the lifetime of the object -- sequence diagrams are read top-down with time passing as we go down. <br /> <br />
  • messages are shown with arrows, returns are dashed arrows. Line arrow heads are asynch calls (but you will see half arrows used instead -- old convention). <br /> <br /> During the bar, the class is active (the message is in the stack frame) <br /> <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • m calls m.1, m.2, etc. m.n calls m.n.1, m.n.2, etc. <br /> Order is 1, 1.1, 1.1.1, 1.2, 1.3, 1.3.1 <br />
  • All classes in each package need to follow this dependency, classes in view can depend on classes in model, but not vice versa. <br />
  • each swim lane has an actor (who is doing the activity) <br /> diamond is a branch <br /> There are also symbols for sending and receiving signals <br />
  • <br />
  • <br />
  • <br />
  • <br />

Introduction to UML Introduction to UML Presentation Transcript

  • Introduction to UML Diagramming
  • Problems have many solutions
  • Design is about choosing one http://morguefile.com/archive/?display=66493 http://flickr.com/photos/chidorian/4795357/in/set-384742/
  • Why model?
  • To visualize http://www.rohdesign.com/weblog/archives/000896.html
  • To communicate Electronic schematic of GEE radar (AMES type 7000) used in second world war by the allies
  • To emphasize DaVinci’s Flush Toilet
  • The UML is a standard graphical notation for describing object-oriented software systems
  • Use UML to visualize, communicate, and emphasize your choices
  • 1 Library checkout 1 Membership return start : Date renewal : Date * due : Date LendRecord Lendable 1 returned : Boolean id newArrival : Boolean * LendRecord(lendable, member, date) calcDueDate(member): Date isDue() : Boolean renew(Date) * Book CD 1 * Member DVD Goal: Understand this
  • : Library aMember aLendable checkout(lendable, member) canBorrow(lendable) numOut(member) opt calcDueDate(member) { canBorrow == true } dueDate record new aLendRecord And this
  • Class Diagram Elements Class Package Class Attributes Operations
  • Class Diagram Elements Association multiplicity navigability role
  • Class Diagram Elements Complex Associations association class key value
  • Class Diagram Elements Dependency depends on
  • Class Diagram Elements Generalization superclass subclasses
  • Class Diagram Elements Providing and Requiring Interfaces implementor uses interface
  • left BinaryTree 1 0..1 0..1 1 add(obj: Obect) remove(obj) root TreeNode Object contains(obj):bool 0..1 right <<interface>> TreeIterator hasNext : bool next : Object PrefixTreeIterator PostfixTreeIterator InfixTreeIterator Example: Binary tree
  • 1 Library checkout 1 Membership return start : Date renewal : Date * due : Date LendRecord Lendable 1 returned : Boolean id newArrival : Boolean * LendRecord(lendable, member, date) calcDueDate(member): Date isDue() : Boolean renew(Date) * Book CD 1 * Member DVD Example: Library Classes
  • Sequence Diagram Elements Object lifeline object lifeline
  • Sequence diagram elements Object activation message activation return bar
  • Sequence diagram elements Object creation and deletion object creation object destruction
  • Sequence diagram elements Callbacks
  • Sequence diagram elements Object calling itself
  • Sequence diagram elements Loops operator guard interaction frame
  • Sequence diagram elements Conditionals alternative separator
  • aPanel child : Component dc : DrawingContext paint(dc) loop paint(dc) drawOperation(args) { forEach child } Example: Panel painting
  • : Library aMember aLendable checkout(lendable, member) canBorrow(lendable) numOut(member) opt calcDueDate(member) { canBorrow == true } dueDate record new aLendRecord Example: Library Checkout
  • 1: checkout(lendable, member) 1.1: canBorrow(lendable) :Library 1.3: record aMember 1.1.1: numOut(member) 1.2: calcDueDate(member) <<create>> 1.3.1: new aLendable aLendRecord Communication Diagram
  • Data View Model SQLServer Oracle Package Diagram
  • Actor Actor Actor start Activity fork Activity Activity {condition} Activity Activity {condition} join end Activity Diagram
  • <<include>> Common Role Use Case Use Case Role <<include>> Use Case Use Case Role Role Use Case Diagram
  • UML in UML
  • Resources • UML Distilled by Martin Fowler • http://bdn.borland.com/article/ 0,1410,31863,00.html • http://www.uml.org • http://www.agilemodeling.com
  • (cc) 2006 Lou Franco Released under the following creative commons license Attribution-NonCommercial-ShareAlike 2.0 http://creativecommons.org/licenses/by-nc-sa/2.0 Each photograph used has a URL for attribution. Please see the original site for the photo’s license.