Book contents
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 General Diagramming Guidelines
- 3 Guidelines for Common UML Modeling Elements
- 4 UML Use-Case Diagrams
- 5 UML Class Diagrams
- 6 UML Package Diagrams
- 7 UML Sequence Diagrams
- 8 UML Communication Diagrams
- 9 UML State Machine Diagrams
- 10 UML Activity Diagrams
- 11 UML Component Diagrams
- 12 UML Deployment Diagrams
- 13 UML Object Diagrams
- 14 UML Composite Structure Diagrams
- 15 UML Interaction Overview Diagrams
- 16 UML Timing Diagrams
- 17 Agile Modeling
- Bibliography
- Index
6 - UML Package Diagrams
Published online by Cambridge University Press: 17 December 2010
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 General Diagramming Guidelines
- 3 Guidelines for Common UML Modeling Elements
- 4 UML Use-Case Diagrams
- 5 UML Class Diagrams
- 6 UML Package Diagrams
- 7 UML Sequence Diagrams
- 8 UML Communication Diagrams
- 9 UML State Machine Diagrams
- 10 UML Activity Diagrams
- 11 UML Component Diagrams
- 12 UML Deployment Diagrams
- 13 UML Object Diagrams
- 14 UML Composite Structure Diagrams
- 15 UML Interaction Overview Diagrams
- 16 UML Timing Diagrams
- 17 Agile Modeling
- Bibliography
- Index
Summary
A UML package diagram depicts two or more packages and the dependencies between them. A package is a UML construct that enables you to organize model elements, such as use cases or classes, into groups. Packages are depicted as file folders and can be applied on any UML diagram, although any diagram that depicts only packages (and their interdependencies) is considered a package diagram. UML package diagrams are in fact new to UML 2, although they were informally part of UML 1—what we called package diagrams in the past were in fact UML class diagrams or UML use-case diagrams consisting only of packages. Create a package diagram to
■ depict a high-level overview of your requirements,
■ depict a high-level overview of your design,
■ logically modularize a complex diagram,
■ organize source code,
■ model a framework (Evitts 2000).
Class Package Diagram Guidelines
Create Class Package Diagrams to Logically Organize Your Design
Figure 28 depicts a UML package diagram that organizes a collection of related classes. In addition to the package guidelines presented later in this chapter, apply the following heuristics to organize classes into packages:
■ Classes of a framework belong in the same package.
■ Classes in the same inheritance hierarchy typically belong in the same package.
■ Classes related to one another via aggregation or composition often belong in the same package.
■ Classes that collaborate with each other a lot often belong in the same package.
Create UML Component Diagrams to Physically Organize Your Design
If you have decided on a component-based approach to design, such as that promoted by Enterprise Java Beans (EJB) or Visual Basic, you should prefer a UML component diagram over a UML package diagram to depict your physical design.
- Type
- Chapter
- Information
- The Elements of UML™ 2.0 Style , pp. 73 - 79Publisher: Cambridge University PressPrint publication year: 2005