5.3 DependenciesFigure 5-1 shows components associated with the project management system, and Figure 5-3 shows nodes associated with the project management system, but how are components related to undifferentiated and differentiated classes, packages, subsystems, and to other components and nodes? Specialized types of dependencies — called reside, use, and deploy dependencies — address these questions. The next few sections in this chapter discuss these specialized types of dependencies. Dependences in general are discussed in Chapter 3. 5.3.1 Reside DependenciesA reside dependency from a component to any UML element indicates that the component is a client of the element, which is itself considered a supplier, and that the element resides in the component. The element may be an undifferentiated or differentiated class, package, or subsystem. An element may reside in any number of components, and a component may have any number of elements that reside in it. A reside dependency is shown as a dashed arrow from a client component to a supplier element marked with the reside keyword. Figure 5-5 shows that the User Interface and Utility packages reside in the User Interface component. Because the User Interface package depends on the Utility package, the User Interface and Utility packages must reside in the same component; otherwise, the User Interface package would not be able to use the Utility package. Figure 5-5. Reside dependencies for packagesFigure 5-6 shows that the Business Processing subsystem and Utility package reside in the Business Processing component. Because the Business Processing subsystem provides the IBusiness Processing interface, the Business Processing component also provides the interface. Again, because the Business Processing subsystem depends on the Utility package, the Business Processing subsystem and Utility package must reside in the same component; otherwise, the Business Processing subsystem would not be able to use the Utility package. Remember, it's perfectly fine for an element to reside in more than one component. For example, the Utility package resides in both the User Interface and Business Processing components, and, as you will soon see, in the Data component. Figure 5-6. Reside dependencies for subsystemsAlternatively, an element that resides inside a component may be shown nested inside the component. Figure 5-7 shows that the Data subsystem and Utility package reside in the Data component. The Data subsystem is drawn inside the Data component, while the reside dependency to Utility is still drawn in the same manner as in Figures Figure 5-5 and Figure 5-6. Figure 5-7. Reside dependencies using nestingNotice that the Utility package resides in all the components in Figures Figure 5-5, Figure 5-6, and Figure 5-7, because each component described in those figures has a package that uses the Utility package. Details of the Utility package are discussed in Chapter 3. 5.3.2 Use DependenciesA use dependency from a client component to a supplier component indicates that the client component uses or depends on the supplier component. A use dependency from a client component to a supplier component's interface indicates that the client component uses or depends on the interface provided by the supplier component. A use dependency is shown as a dashed arrow from a client component to a supplier component or a supplier component's interface. The dependency may be marked with the use keyword; however, the keyword is often omitted because this is the default, and the meaning is evident from how the dependency is used. Figure 5-8 shows how the various components of the project management system are related:
Figure 5-8. Use dependencies5.3.3 Deploy DependenciesA deploy dependency from a client component to a supplier node indicates that the client component is deployed on the supplier node. A deploy dependency is shown as a dashed arrow from a client component to a supplier node marked with the deploy keyword. Figure 5-9 shows that the User Interface component is deployed on the Desktop Client node. Figure 5-9. Deploy dependenciesFigure 5-10 shows that the Business Processing component is deployed on the Business-Processing Server node. Figure 5-10. Deploy dependencies for a subsystemAlternatively, a component that is deployed on a node may be shown nested inside the node. Figure 5-11 shows that the Data component is deployed on the Database Server node. Figure 5-11. Deploy dependencies using nesting |