DOC PREVIEW
UMD CMSC 132 - UML Examples

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

Save
View full document
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
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
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
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
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
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:

1UML ExamplesFawzi EmadChau-Wen TsengDepartment of Computer ScienceUniversity of Maryland, College ParkUML Class DiagramsRepresent the (static) structure of the systemGeneral In JavaName NameState VariablesBehavior Methods2Relationships Between ClassesAssociationPermanent, structural, “has a”Solid line (arrowhead optional)DependencyTemporary, “uses a”Dotted line with arrowheadGeneralizationInheritance, “is a”Solid line with open (triangular) arrowheadImplementationDotted line with open (triangular) arrowheadORAssociationDenotes permanent, structural relationship State of class A contains class BRepresented by solid line (arrowhead optional)Car and Engine classes know about each other3Associations w/ Navigation InformationCan indicate direction of relationshipRepresented by solid line with arrowheadGas Pedal class knows about Engine class Engine class doesn’t know about Gas Pedal classAssociations w/ Navigation InformationDenotes “has-a” relationship between classes“Gas Pedal” has a “Engine”State of Gas Pedal class contains instance of Engine class ⇒can invoke its methods4Multiplicity of AssociationsSome relationships may be quantifiedMultiplicity denotes how many objects the source object can legitimately referenceNotation*⇒0, 1, or more5⇒5 exactly5..8⇒between 5 and 8, inclusive5..*⇒5 or moreMultiplicity of AssociationsMany-to-oneBank has many ATMs, ATM knows only 1 bankOne-to-manyInventory has many items, items know 1 inventory5Association – AggregationSpecial case of association denotes a “consists of” hierarchyAggregate is the parent classComponents are the children classRepresented by line ending in open diamond1Exhaust SystemMuffler Tailpipe0..2DependencyDenotes dependence between classesAlways directed (Class A depends on B)Represented by dotted line with arrowheadA depends on B AB6DependencyCaused by class methodsMethod in Class A temporarily “uses a” object of type Class BChange in Class B may affect class AA uses object of class B ABDependencyDependence may be caused byLocal variableParameterReturn valueExampleClass A { Class B {B Foo(B x) { …B y = new(); …return y; …}} }7Dependency ExampleClass Driver depends on Class Car GeneralizationDenotes inheritance between classesCan view as “is-a” relationshipRepresented by line ending in (open) triangleLaptop, Desktop, PDA inherit state & behavior from Computers8ImplementationDenotes class implements Java interface Represented by dotted line ending in (open) triangleA implements interface B A «B»UML ExamplesRead UML class diagramTry to understand relationshipsExamplesPets & ownersComputer disk organizationLibrary booksBanking systemHome heating systemPrinting system9UML Example – Veterinary SystemTry to read & understand UML diagramUML Example – Veterinary SystemTry to read & understand UML diagram• 1 or more Pets associated with 1 PetOwner10UML Example – Computer SystemTry to read & understand UML diagramUML Example – Computer SystemTry to read & understand UML diagram• 1 CPU associated with 0 or more Controllers• 1-4 DiskDrives associated with 1 SCSIController• SCSIController is a (specialized) Controller11UML Example – Library SystemTry to read & understand UML diagramUML Example – Library SystemTry to read & understand UML diagram• 1 or more Book associated with 1 or more Pages• Patron & Shelf temporarily use (depend on) Books12UML Example – Banking SystemTry to read & understand UML diagramUML Example – Banking System• 1 Bank associated with 0 or more Accounts• Checking, Savings, MoneyMarket are Accounts13UML Example – Home Heating SystemTry to read & understand UML diagramUML 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 Thermostat14UML Example – Printing


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
Download UML Examples
Our administrator received your request to download this document. We will send you the file to your email shortly.
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 2 2 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?