uml4
TRANSCRIPT
-
8/12/2019 UML4
1/27
-
8/12/2019 UML4
2/27
2 Wolfgang Pelz 2000-04UML3
Package Diagram
general purpose grouping mechanism toorganize semantically related modelelements
can be considered a special case of a classdiagram
define a namespace or context (container)within which each name must be unique
-
8/12/2019 UML4
3/27
3 Wolfgang Pelz 2000-04UML3
Package Diagram
can be nested (implied import of parent) may hide their contents
-
8/12/2019 UML4
4/27
4 Wolfgang Pelz 2000-04UML3
Package Notation
-
8/12/2019 UML4
5/27
5 Wolfgang Pelz 2000-04UML3
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 theenclosed elements are also destroyed
-
8/12/2019 UML4
6/27
6 Wolfgang Pelz 2000-04UML3
Visibilityspecifiers: public - element is visible to a package that
imports the elements enclosing package protected - element is visible to a package
that inherits from another package
private - element is not visible outside the package
-
8/12/2019 UML4
7/27
7 Wolfgang Pelz 2000-04UML3
More visibility
public parts of a package constitute the packages interface
friend dependency relationship: two packages that are friends may see allelements in the packages, independent of
visibility
-
8/12/2019 UML4
8/27
8 Wolfgang Pelz 2000-04UML3
Usage
model an import relationship with thestereotype import on the dependency
stereotype access permits usage withoutadding contents to namespace; requiresfully qualified name
public parts of package are called its exports
-
8/12/2019 UML4
9/27
-
8/12/2019 UML4
10/27
10 Wolfgang Pelz 2000-04UML3
Example
-
8/12/2019 UML4
11/27
11 Wolfgang Pelz 2000-04UML3
Package Dependency elements of the dependent package know
about or are coupled to elements in thetarget package
a dependency between two packages existsif there is a dependency between any twoclasses in those packages
dependencies are not transitive rule of thumb : reduce # of dependencies
(why?)
-
8/12/2019 UML4
12/27
12 Wolfgang Pelz 2000-04UML3
Dependency Example
-
8/12/2019 UML4
13/27
13 Wolfgang Pelz 2000-04UML3
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
-
8/12/2019 UML4
14/27
14 Wolfgang Pelz 2000-04UML3
Software Component
source component: source codeimplementing 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, ordynamic library file
-
8/12/2019 UML4
15/27
15 Wolfgang Pelz 2000-04UML3
Software Component
Executable component: executable programthat is the result of linking all binary
components
-
8/12/2019 UML4
16/27
16 Wolfgang Pelz 2000-04UML3
Component
is physical: lives in the world of bits, notconcepts
is replaceable or substitutable is part of a system; does not stand alone conforms to and provides the realization of
a set of interfaces
-
8/12/2019 UML4
17/27
17 Wolfgang Pelz 2000-04UML3
Notation
-
8/12/2019 UML4
18/27
-
8/12/2019 UML4
19/27
19 Wolfgang Pelz 2000-04UML3
Another Example
-
8/12/2019 UML4
20/27
20 Wolfgang Pelz 2000-04UML3
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
-
8/12/2019 UML4
21/27
21 Wolfgang Pelz 2000-04UML3
Deployment Diagram
shows physical relationships amongsoftware and hardware components
each node represents some kind ofcomputational resource, usually a piece ofhardware (e.g., computer, printer, card
reader, sensor) a node exists at run-time
-
8/12/2019 UML4
22/27
-
8/12/2019 UML4
23/27
23 Wolfgang Pelz 2000-04UML3
Node Notation
-
8/12/2019 UML4
24/27
24 Wolfgang Pelz 2000-04UML3
Dependency (Component)Run-time Relationship
-
8/12/2019 UML4
25/27
25 Wolfgang Pelz 2000-04UML3
Supports Relationship (Node)
Part of : a node hosts a componentStatic
-
8/12/2019 UML4
26/27
26 Wolfgang Pelz 2000-04UML3
Becomes Relationshipmigration of components or objects
-
8/12/2019 UML4
27/27
27 Wolfgang Pelz 2000-04UML3
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)