Packages are a syntactical mechanism to group classes. They are convenient to separate the own work from code libraries provided by others.
In YAON, the same icon as in UML ([RAT97a, P. 7ff]) is used to
depict a package (Fig. 21). A package is a large
rectangle with a small rectangle on top. The name is placed in the
small rectangle. If no contents of the package is shown, the name may
be placed in the large rectangle (not shown here).
Packages can contain classes and other packages as depicted in figure 22. In order to access a package, the import relationship is defined between packages. This relation is depicted with a broken arrow as in figure 23.
A package can import a whole (sub)package or only a class of a package. The different possibilities are depicted in figure 24. The package pack_c imports the class Class from the package Big_pack. The package pack_e imports the whole package Big_pack with all its subpackages. The package pack_d imports only the package subpack_a from the package Big_Pack. Public classes are always available by their fully qualified names. In example 24, the class Class is imported by the package pack_c and therefore it is not necessary to use the fully qualified name inside of the package pack_c. However it must be fully qualified from the pack_d and pack_e if they must refer to it.
|
|