01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Session 24—Modeling the Development Environment 249<br />

Model elements in a package<br />

One of the most common uses for the package is to hold your diagrams. In most modeling<br />

tools, packages provide a nesting mechanism (that is, a package may contain other packages,<br />

which in turn contain diagrams). The packages in this scheme refer to systems, subsystems,<br />

and diagrams, respectively. The scheme can contain as many levels as the problem<br />

requires. Figure 24-6 shows an example of the package Shipping that holds the Class diagram<br />

that supports the functions of the Shipping subsystem.<br />

Shipping<br />

<br />

ships<br />

1..1<br />

0..*<br />

Shipping Clerk<br />

1..1<br />

packs<br />

0..*<br />

Shipment ship OrderProcessing::Order<br />

0..* 1..1<br />

0..1<br />

0..1<br />

1..*<br />

Purchasing::Product<br />

1..*<br />

Figure 24-6 A package containing a Class diagram<br />

Actually, the more common way to represent this in a modeling tool is to open a package<br />

and get a diagram in a new window or canvas. Conceptually, the diagram resides in the<br />

package as I have represented in Figure 24-6. But the tool does not represent it that way.<br />

Figure 24-6 also shows two examples of the import relationship. The Order and Product<br />

classes use the qualifying notation package :: element. This notation tells you that the two<br />

classes came from the named package (that is, Order is imported from the OrderProcessing<br />

package and Product is imported from Purchasing). This clearly identifies the fact that the<br />

class is defined in another package but is referenced in this package.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!