DOC PREVIEW
UMD CMSC 132 - UML Examples

This preview shows page 1-2-3-4-5 out of 14 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

UML Examples Fawzi Emad Chau Wen Tseng Department of Computer Science University of Maryland College Park UML Class Diagrams Represent the static structure of the system General Name State Behavior In Java Name Variables Methods 1 Relationships Between Classes Association OR Permanent structural has a Solid line arrowhead optional Dependency Temporary uses a Dotted line with arrowhead Generalization Inheritance is a Solid line with open triangular arrowhead Implementation Dotted line with open triangular arrowhead Association Denotes permanent structural relationship State of class A contains class B Represented by solid line arrowhead optional Car and Engine classes know about each other 2 Associations w Navigation Information Can indicate direction of relationship Represented by solid line with arrowhead Gas Pedal class knows about Engine class Engine class doesn t know about Gas Pedal class Associations w Navigation Information Denotes has a relationship between classes Gas Pedal has a Engine State of Gas Pedal class contains instance of Engine class can invoke its methods 3 Multiplicity of Associations Some relationships may be quantified Multiplicity denotes how many objects the source object can legitimately reference Notation 5 5 8 5 0 1 or more 5 exactly between 5 and 8 inclusive 5 or more Multiplicity of Associations Many to one Bank has many ATMs ATM knows only 1 bank One to many Inventory has many items items know 1 inventory 4 Association Aggregation Special case of association denotes a consists of hierarchy Aggregate is the parent class Components are the children class Represented by line ending in open diamond Exhaust System 1 Muffler 0 2 Tailpipe Dependency Denotes dependence between classes Always directed Class A depends on B Represented by dotted line with arrowhead A B A depends on B 5 Dependency Caused by class methods Method in Class A temporarily uses a object of type Class B Change in Class B may affect class A A B A uses object of class B Dependency Dependence may be caused by Local variable Parameter Return value Example Class A B Foo B x B y new Class B return y 6 Dependency Example Class Driver depends on Class Car Generalization Denotes inheritance between classes Can view as is a relationship Represented by line ending in open triangle Laptop Desktop PDA inherit state behavior from Computers 7 Implementation Denotes class implements Java interface Represented by dotted line ending in open triangle A B A implements interface B UML Examples Read UML class diagram Try to understand relationships Examples Pets owners Computer disk organization Library books Banking system Home heating system Printing system 8 UML Example Veterinary System Try to read understand UML diagram UML Example Veterinary System Try to read understand UML diagram 1 or more Pets associated with 1 PetOwner 9 UML Example Computer System Try to read understand UML diagram UML Example Computer System Try to read understand UML diagram 1 CPU associated with 0 or more Controllers 1 4 DiskDrives associated with 1 SCSIController SCSIController is a specialized Controller 10 UML Example Library System Try to read understand UML diagram UML Example Library System Try to read understand UML diagram 1 or more Book associated with 1 or more Pages Patron Shelf temporarily use depend on Books 11 UML Example Banking System Try to read understand UML diagram UML Example Banking System 1 Bank associated with 0 or more Accounts Checking Savings MoneyMarket are Accounts 12 UML Example Home Heating System Try to read understand UML diagram UML Example Home Heating System Room has 1 Thermostat Each Thermostat associated with 0 or more Heaters ElectricHeater is a specialized Heater AubeTH101D is a specialized Thermostat 13 UML Example Printing System 14


View Full Document

UMD CMSC 132 - UML Examples

Documents in this Course
Notes

Notes

8 pages

Recursion

Recursion

12 pages

Sorting

Sorting

31 pages

HTML

HTML

7 pages

Trees

Trees

19 pages

HTML

HTML

18 pages

Trees

Trees

19 pages

Honors

Honors

19 pages

Lecture 1

Lecture 1

11 pages

Quiz #3

Quiz #3

2 pages

Hashing

Hashing

21 pages

Load more
Loading Unlocking...
Login

Join to view UML Examples and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view UML Examples and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?