|Previous||UML Classes||Table of Contents||UML Packages||Next|
TemplateableElement (from Templates) on page 649
Package (from Kernel ) on page 109
Package specializes TemplateableElement and PackageableElement specializes ParameterableElement to specify that a package
can be used as a template and a PackageableElement as a template parameter.
No additional attributes
No additional associations
No additional constraints
A Package supports the ability to be defined as a template and PackageableElement s may, therefore, be parametered in a package
template. A package template parameter may refer to any element owned or used by the package template, or templates nested
within it, and so on recursively. That is, there are no special rules concerning how the parameters of a package template
A package may be defined to be bound to one or more template packages. The semantics for these bindings is as described in
the general case, with the exception that we need to spell out the rules for merging the results of multiple bindings. In
that case, the effect is the same as taking the intermediate results and merging them into the eventual result using package
merge. This is illustrated by the example below.
See TemplateableElement for a description of the general notation that is defined to support these added capabilities.
The example below shows a package template (named ResourceAllocation) with three formal template parameters. All three formal
template parameters (named Resource, ResourceKind, and System) are unconstrained class template parameters. There is also
a bound package (named CarRental) that substitutes Car for Resource, CarSpec for ResourceKind, and CarRentalSystem for System.
<<bind>> <Resource -> Car, ResourceKind -> CarSpec, System -> CarRentalSystem>
Figure 17.26 -Template Package and Bound Package