UML Tutorial: Package Diagrams
73
The application of these principles to your package designs should help keep you
on track. Also, keep in mind thatyou are not locked into a particular design ifyou
eventually find that it is not working for your project. Package relationships, just
like classes, sometimes require refactoring. Fortunately, the ABAP Workbench
makes it easy for you to reassign development objects to other packages.
7.3 UML Tutorial: Package Diagrams
The component design process can become quite involved, being heavily influ-
enced by the subjective whims of developers that often have conflicting design
goals. Typically, this process evolves over several iterations that gradually reshape
the model to reflect the system that is being implemented. The UML supports the
documentation of this design process with the package diagram. A package dia-
gram allows you to group related classes and interfaces (and other development
objects) into higher-level units called packages.
Note that the overlap between the term "package" in the UML and the ABAP
packages you learned about in Section 7.2, The Package Concept, is purely coin-
cidental. A UML package is a logical concept that could be implemented in many
different ways by various programming languages. However,
as
you will see, the
ABAP package concept aligns veiy closely with the UML package construct.
Figure 7.14 shows an example of
a
package diagram for a simple online travel res-
ervation application built using the Web Dynpro ABAP framework. Each of the
folder-shaped icons in the diagram are packages. The dotted lines between pack-
ages depict dependencies. The direction of the line indicates the direction of the
dependency. For example, the Customer UI and Travel Agent ui packages both
depend on the
WOA
Framework and Travel Reservation Model packages. Similarly,
objects within the Travel Reservation Model package depend on ABAP Dictio-
naiy objects defined within the Travel Reservation Dictionary package.
The formal ABAP package names could have been used in this diagram, but
as
you
can see in Figure 7.14, this is optional in the UML. Like many diagrams in the
UML, there are not a lot of restrictions in terms of the notation for a package
diagram. For example, the package diagram in Figure 7.15 shows some of the
classes inside packages PI and P2. The familiar plus (+) and minus ( ) visibility
tokens indicate whether or not the classes belong to the public or private inter-
face of the package. In this case, class
B
has been added to the package interface of
197