1 © wolfgang pelz 2000-04uml3 uml 3 notations describe how to use reusable software. package...

27
© Wolfgang Pelz 2000-04 UML3 1 UML 3 Notations describe how to use reusable software. Package Component Deployment Node

Post on 19-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

© Wolfgang Pelz 2000-04UML3 1

UML 3

Notations describe how to use reusable software.

PackageComponentDeployment

Node

© Wolfgang Pelz 2000-04UML3 2

Package Diagram

• general purpose grouping mechanism to organize semantically related model elements

• can be considered a special case of a class diagram

• define a namespace or context (container) within which each name must be unique

© Wolfgang Pelz 2000-04UML3 3

Package Diagram

• can be nested (implied import of parent)

• may hide their contents

© Wolfgang Pelz 2000-04UML3 4

Package Notation

© Wolfgang Pelz 2000-04UML3 5

Properties

• a package may own other elements, including classes, interfaces, components, nodes, collaborations, use cases, diagrams, and other packages

• ownership is a composite relationship - if the enclosing package is destroyed, then the enclosed elements are also destroyed

© Wolfgang Pelz 2000-04UML3 6

Visibilityspecifiers:

• public - element is visible to a package that imports the element’s enclosing package

• protected - element is visible to a package that inherits from another package

• private - element is not visible outside the package

© Wolfgang Pelz 2000-04UML3 7

More visibility

• public parts of a package constitute the package’s interface

• friend dependency relationship: two packages that are friends may see all elements in the packages, independent of visibility

© Wolfgang Pelz 2000-04UML3 8

Usage

• model an import relationship with the stereotype import on the dependency

• stereotype access permits usage without adding contents to namespace; requires fully qualified name

• public parts of package are called its exports

© Wolfgang Pelz 2000-04UML3 9

Standard Stereotypes

• facade: package is a view on another package

• framework: package consists of patterns

• stub: proxy for public contents of another package

• subsystem: independent part of the entire system being modeled

• system: represents entire system being modeled

© Wolfgang Pelz 2000-04UML3 10

Example

© Wolfgang Pelz 2000-04UML3 11

Package Dependency• elements of the dependent package know about

or are coupled to elements in the target package

• a dependency between two packages exists if there is a dependency between any two classes in those packages

• dependencies are not transitive

• rule of thumb: reduce # of dependencies (why?)

© Wolfgang Pelz 2000-04UML3 12

Dependency Example

© Wolfgang Pelz 2000-04UML3 13

Component Diagram

• a component represents the physical packaging of related elements such as classes, interfaces, and collaborations

• defined as “a reusable part that provides the physical packaging of a collection of model element instances”

• typically a component is an implementation file in the development environment

© Wolfgang Pelz 2000-04UML3 14

Software Component

• source component: source code implementing one or more classes; meaningful at compile-time

• binary component: object code that is a result of compiling a source component, e.g., object code file, static library file, or dynamic library file

© Wolfgang Pelz 2000-04UML3 15

Software Component

• Executable component: executable program that is the result of linking all binary components

© Wolfgang Pelz 2000-04UML3 16

Component

• is physical: lives in the world of bits, not concepts

• is replaceable or substitutable

• is part of a system; does not stand alone

• conforms to and provides the realization of a set of interfaces

© Wolfgang Pelz 2000-04UML3 17

Notation

© Wolfgang Pelz 2000-04UML3 18

Example

© Wolfgang Pelz 2000-04UML3 19

Another Example

© Wolfgang Pelz 2000-04UML3 20

Understanding the Example

• Realization: inheritance, class relationship, one class is part of the definition of the other.

• Dependency: uses, object relationship, one object uses another object.– Inclusion: one object is part of the other object– Call: one object calls a method of the other

© Wolfgang Pelz 2000-04UML3 21

Deployment Diagram

• shows physical relationships among software and hardware components

• each node represents some kind of computational resource, usually a piece of hardware (e.g., computer, printer, card reader, sensor)

• a node exists at run-time

© Wolfgang Pelz 2000-04UML3 22

Architecture

• see which components are executing in a node

• see which logical elements (classes, objects, collaborations, etc.) are implemented in the component

• be able to trace the element to the initial requirement analysis of the system (typically through the use case diagram)

© Wolfgang Pelz 2000-04UML3 23

Node Notation

© Wolfgang Pelz 2000-04UML3 24

Dependency (Component) Run-time Relationship

© Wolfgang Pelz 2000-04UML3 25

Supports Relationship (Node)

• Part of : a node hosts a component Static

© Wolfgang Pelz 2000-04UML3 26

Becomes Relationshipmigration of components or objects

© Wolfgang Pelz 2000-04UML3 27

Becomes Relationshipmigration of components or objects

• The directory (object) /home/vonneumann/faculty/xiao

• on Samba Server (node)

• becomes

• “z:” drive (object) on my laptop (node)