Package diagram
Encyclopedia
A package diagram in the Unified Modeling Language
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...
depicts the dependencies
Dependency (UML)
A dependency in the Unified Modeling Language exists between two defined elements if a change to the definition of one may result in a change to the other...
between the packages
Package (UML)
A package in the Unified Modeling Language is used "to group elements, and to provide a namespace for the grouped elements". A package may contain other packages, thus providing for a hierarchical organization of packages....
that make up a model.
Overview
In addition to the standard UML DependencyDependency (UML)
A dependency in the Unified Modeling Language exists between two defined elements if a change to the definition of one may result in a change to the other...
relationship, there are two special types of dependencies defined between packages:
- package import
- package merge
A package import is "a relationship between an importing namespace and a package, indicating that the importing namespace adds the names of the members of the package to its own namespace."
By default, an unlabeled dependency between two packages is interpreted as a package import relationship.
In this relationship elements within the target package will be imported in source package.
A package merge is "a directed relationship between two packages, that indicates that the contents of the two packages are to be combined. It is very similar to Generalization in the sense that the source element conceptually adds the characteristics of the target element to its own characteristics resulting in an element that combines the characteristics of both"
In this relationship if an element exists within source element's definition and target also then the source element's definition's will be expanded to include target element's definitions.
Elements
1)Package:It is a general purpose mechanism for organizing model elements & diagrams into groups.It provides an encapsulated namespace within which all the names must be unique.It is used to group semantically related elements.It is a namespace as well as an element that can be contained in other package's namespaces.2)Class:It is a representation of objects,that reflects their structure and behavior within the system.It is a template from which actually running instances are created.Classes usually describe logical structure of system..
3)Interface:It is a specification of behavior.By implementing an interface class are required to support the behavior.
4)Object:It is an instance of class.It is often used in analysis to represent numerous artifacts and items that exist.
5) Table:It is a stereotyped class.
Usage
Package diagrams can use packages containing use cases to illustrate the functionality of a software system.Package diagrams can use packages that represent the different layers of a software system to illustrate the layered architecture of a software system. The dependencies between these packages can be adorned with labels / stereotypes to indicate the communication mechanism between the layers.
External links
- Introduction to UML 2 Package Diagrams by Scott W. Ambler
- UML 2 Package Diagrams