Jump to content

Package diagram: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Replaced obsolete text and references by current version.
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Image:Deployment Model Structure.PNG|thumb|320px|[[Package (UML)|Packages]] containing [[Node (UML)|node]]s and [[Artifact (UML)|artifact]]s.]]
[[Image:Deployment Model Structure.PNG|thumb|320px|[[Package (UML)|Packages]] containing [[Node (UML)|node]]s and [[Artifact (UML)|artifact]]s.]]
{{UML diagram types}}
{{UML diagram types}}

A '''package diagram''' in the [[Unified Modeling Language]] depicts the [[Dependency (UML)|dependencies]] between the [[Package (UML)|packages]] that make up a model.
A '''package diagram'''<ref name=OMG>{{cite book
|chapter=Packages
|title=Unified Modeling Language 2.5.1
|series=[[Object Management Group |OMG]] Document Number formal/2017-12-05
|date=December 2017
|publisher=[[Object Management Group]] Standards Development Organization (OMG SDO)
|page=241
|url=https://www.omg.org/spec/UML/2.5.1/PDF
}}
</ref>
in the [[Unified Modeling Language]] depicts "specializations for [[Model]]s and for [[Profile (UML) |Profile]]s that organize [[Extension (model theory) |extension]]s to UML."<ref name=OMG/>


== Overview ==
== Overview ==
Line 8: Line 19:
* package merge
* 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." <ref>[ OMG Unified Modeling Language (OMG UML), Infrastructure, V2.1.2] p. 149.</ref>
A ''package import'' is "a directed 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."<ref>{{cite book
|chapter=Namespaces
|title=Unified Modeling Language 2.5.1
|series=[[Object Management Group |OMG]] Document Number formal/2017-12-05
|date=December 2017
|publisher=[[Object Management Group]] Standards Development Organization (OMG SDO)
|page=27
|url=https://www.omg.org/spec/UML/2.5.1/PDF
}}
</ref>
By default, an unlabeled dependency between two packages is interpreted as a package import relationship.
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 into the source package.
In this relationship, elements within the target package will be imported into the 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 Generalisation 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"<ref>[http://www.omg.org/spec/UML/2.1.2/Infrastructure/PDF OMG Unified Modeling Language (OMG UML), Infrastructure, V2.1.2] p. 160.</ref>
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 Generalisation 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".<ref>[http://www.omg.org/spec/UML/2.1.2/Infrastructure/PDF OMG Unified Modeling Language (OMG UML), Infrastructure, V2.1.2] {{Webarchive|url=https://web.archive.org/web/20170109070927/http://www.omg.org/spec/UML/2.1.2/Infrastructure/PDF/ |date=2017-01-09 }}, p. 160.
</ref>
In this relationship, if an element exists within both the source package and the target package, then the source element's definition will be expanded to include the target element's definition.
In this relationship, if an element exists within both the source package and the target package, then the source element's definition will be expanded to include the target element's definition.
[[Image:Package Diagram.PNG|thumb|320px|[[Package (UML)|Packages]] containing [[use case]]s.]]
[[Image:Package Diagram.PNG|thumb|320px|[[Package (UML)|Packages]] containing [[use case]]s.]]

In the current Unified Modeling Language 2.5.1 (December 2017), ''Package Merge'' is no longer used within the specification. "Every metaclass is specified completely in one clause."<ref>{{cite book
|chapter= Specification Simplification
|title=Unified Modeling Language 2.5.1
|series=[[Object Management Group |OMG]] Document Number formal/2017-12-05
|date=December 2017
|publisher=[[Object Management Group]] Standards Development Organization (OMG SDO)
|page=11
|url=https://www.omg.org/spec/UML/2.5.1/PDF
}}
</ref>


==Elements==
==Elements==
Line 28: Line 60:
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.
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.


== When To Use ==
== When to use ==
# It is used in large scale systems to picture dependencies between major elements in the system
# It is used in large scale systems to picture dependencies between major elements in the system
# Package diagrams represent a compile time grouping mechanism.
# Package diagrams represent a compile time grouping mechanism.
#They can be used in diagramming.


==References==
==References==
Line 41: Line 72:
* [http://www.agilemodeling.com/artifacts/packageDiagram.htm Introduction to UML 2 Package Diagrams] by [[Scott W. Ambler]]
* [http://www.agilemodeling.com/artifacts/packageDiagram.htm Introduction to UML 2 Package Diagrams] by [[Scott W. Ambler]]
* [http://www.uml-diagrams.org/package-diagrams.html UML 2 Package Diagrams]
* [http://www.uml-diagrams.org/package-diagrams.html UML 2 Package Diagrams]
* [www.amazon.com/UML-Distilled-Standard-Modeling-Language/dp/0321193687 UML Distilled Third edition]


{{UML}}
{{UML}}

Latest revision as of 04:42, 4 June 2024

Packages containing nodes and artifacts.

A package diagram[1] in the Unified Modeling Language depicts "specializations for Models and for Profiles that organize extensions to UML."[1]

Overview

[edit]

In addition to the standard UML Dependency relationship, there are two special types of dependencies defined between packages:

  • package import
  • package merge

A package import is "a directed 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."[2] 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 into the 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 Generalisation 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".[3] In this relationship, if an element exists within both the source package and the target package, then the source element's definition will be expanded to include the target element's definition.

Packages containing use cases.

In the current Unified Modeling Language 2.5.1 (December 2017), Package Merge is no longer used within the specification. "Every metaclass is specified completely in one clause."[4]

Elements

[edit]
  1. Package: a general purpose mechanism for organising 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 packages' namespaces.
  2. Class: a representation of an object that reflects its structure and behavior within the system. It is a template from which running instances are created. Classes usually describe the logical structure of the system.
  3. Interface: a specification of behavior. An implementation class must be written to support the behavior of an interface class.
  4. Object: an instance of a class. It is often used in analysis to represent an artifact or other item.
  5. Table: a stereotyped class.

Usage

[edit]

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.

When to use

[edit]
  1. It is used in large scale systems to picture dependencies between major elements in the system
  2. Package diagrams represent a compile time grouping mechanism.

References

[edit]
  1. ^ a b "Packages". Unified Modeling Language 2.5.1. OMG Document Number formal/2017-12-05. Object Management Group Standards Development Organization (OMG SDO). December 2017. p. 241.
  2. ^ "Namespaces". Unified Modeling Language 2.5.1. OMG Document Number formal/2017-12-05. Object Management Group Standards Development Organization (OMG SDO). December 2017. p. 27.
  3. ^ OMG Unified Modeling Language (OMG UML), Infrastructure, V2.1.2 Archived 2017-01-09 at the Wayback Machine, p. 160.
  4. ^ "Specification Simplification". Unified Modeling Language 2.5.1. OMG Document Number formal/2017-12-05. Object Management Group Standards Development Organization (OMG SDO). December 2017. p. 11.
[edit]