Download presentation
Presentation is loading. Please wait.
1
A Brief Picture of UML
2
What is UML anyway? “Unified Modeling Language” Common (unified) graphical notation for object data structs 3 purposes: Communication -- help express designs among group Documentation -- describe what will be/has been built Tool support -- automatic code analysis/generation
3
Parts of UML Not just one language -- actually 13 types of diagrams Class -- (static) relationships among classes -- what “is-a”, “has-a”, etc. relationships exist? Activity -- how do modules/objects communicate? Use case -- how do people interact with the thing? Package -- describes namespaces State machine Etc...
4
Class Diagrams Show relationships (is-a, has-a, etc.) among classes (not objects) Describes types/methods in system, not a picture of what’s actually in memory Handy to see what types are in system, what depends on what (how changes will ripple through system), etc. Doesn’t have to show everything -- just important stuff Good rule of thumb: UML is for clarity -- don’t add stuff that will obscure the point!
5
The Class -- basic entity java.util.Vector - _size: int=0 - _capacityIncrement: int - _data: Object[*] + add(Object): boolean + add(int,Object) + contains(Object): boolean + toArray: Object[*]
6
Interfaces > java.util.List add(Object): boolean add(int,Object) addAll(Collection): boolean contains(Object): boolean toArray: Object[*] set(int,Object): Object remove(int): Object
7
Abstract Classes java.util.AbstractList - _listBacking: Object[*] - _size: int=0 + get(int): Object + size: int + set(int,Object): Object + add(int,Object) + remove(int)
8
Putting things together... java.util.Vector -_capacityIncrement: int > java.util.List add(Object): boolean add(int,Object) addAll(Collection): boolean contains(Object): boolean toArray: Object[*] set(int,Object): Object remove(int): Object java.util.AbstractList - _listBacking: Object[*] - _size: int=0 + get(int): Object + size: int + set(int,Object): Object + add(int,Object) + remove(int) + get(int): Object + size: int
9
Has-a relationships & multiplicities subaru.vehicle.OutbackSport - _fuelCapacity: float - _fuelLevel: float + accelerate(float): float + turn(float): float + shift(int): boolean firestone.Tire - _radius: float - _age: float - _treadlife: float Passenger - _name: String subaru.engine.Outback - _displacement: float - _cylinders: int - _age: float + setFuelLev(float) + getTorque: float + getTemperature: float 1 1 1 4 1 [1..5]
10
An industrial-strength example
11
Same example, toned down a bit...
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.