1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node
2 © Wolfgang Pelz UML3 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
3 © Wolfgang Pelz UML3 Package Diagram can be nested (implied import of parent) may hide their contents
4 © Wolfgang Pelz UML3 Package Notation
5 © Wolfgang Pelz UML3 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
6 © Wolfgang Pelz UML3 Visibility specifiers: 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
7 © Wolfgang Pelz UML3 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
8 © Wolfgang Pelz UML3 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
9 © Wolfgang Pelz UML3 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
10 © Wolfgang Pelz UML3 Example
11 © Wolfgang Pelz UML3 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?)
12 © Wolfgang Pelz UML3 Dependency Example
13 © Wolfgang Pelz UML3 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
14 © Wolfgang Pelz UML3 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
15 © Wolfgang Pelz UML3 Software Component Executable component: executable program that is the result of linking all binary components
16 © Wolfgang Pelz UML3 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
17 © Wolfgang Pelz UML3 Notation
18 © Wolfgang Pelz UML3 Example
19 © Wolfgang Pelz UML3 Another Example
20 © Wolfgang Pelz UML3 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
21 © Wolfgang Pelz UML3 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
22 © Wolfgang Pelz UML3 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)
23 © Wolfgang Pelz UML3 Node Notation
24 © Wolfgang Pelz UML3 Dependency (Component) Run-time Relationship
25 © Wolfgang Pelz UML3 Supports Relationship (Node) Part of : a node hosts a component Static
26 © Wolfgang Pelz UML3 Becomes Relationship migration of components or objects
27 © Wolfgang Pelz UML3 Becomes Relationship migration of components or objects The directory (object) /home/vonneumann/faculty/xiao on Samba Server (node) becomes “z:” drive (object) on my laptop (node)