[BRJ99] defines a package as a "general purpose mechanism for organizing elements into groups." Packages are used as containers to include modeling elements that are logically related and can be manipulated as a group. Modeling elements that can be included in a package may be classes, interfaces, components, different kinds of diagrams, and even other packages. A package does not represent any abstraction of the elements it owns. The ownership relation in a package is strong; if the package is destroyed, its contained elements are destroyed as well. A package has a name to identify it from other packages. The UML symbol for a package is shown in Figure 3-10.


Figure 3-10. The UML symbol for a package.

Package Weather will contain all model elements related to weather. They can be classes, interfaces, components, and different diagrams. As packages are only used for storing purposes, they do not have any representation in the implementation, except for maybe as directories. During the process of creating packages, the principle of modularity is used.

0 0

Post a comment