OCUP2F 04 Package Diagram

From Training Material
Jump to navigation Jump to search

Module 6. Package Diagram⌘

References⌘

  • J.D. Baker, Model Organization with Packages and the Package Diagram, White Paper, May 2013.

Named Element, Namespace⌘

  • Named Element represents an element that may have a name and a visibility
  • Namespace is a named element that can own other named elements
  • Each named element may be owned by at most one namespace
  • Namespace provides a container for named elements
  • All the members of a namespace are distinguishable within it

Package⌘

  • Package is used to group elements, and provides a namespace for the grouped elements.
  • A Packageable Element is a Named Element that may be owned directly by a Package.
  • The visibility of a packagedElement may be indicated by preceding the name by a visibility symbol (‘+’ for public and ‘-’ for private).
  • Default Packageable Element visibility is public.
  • qualified name:
package name::element name

Package nesting⌘

Package relationship⌘

  • Some elements from package B depends on some elements from package A

Package Import, Access⌘

A package import is defined as a directed relationship that identifies a package whose members are to be imported by a namespace.

Two types:

  • «import» for a public package import
    • transitive: if A imports B and B imports C then A indirectly imports C
  • «access» for a private package import
    • intransitive

Package Import Example 1⌘

  • elements in Types are imported to ShoppingCart, and then further imported to WebShop
  • elements of Auxiliary are only accessed from ShoppingCart, and cannot be referenced from WebShop

Package Import Example 2⌘

Package vs Diagram Frame⌘

Model⌘

  • A Model is a description of a system - not only software and hardware but organizations and processes.
  • It describes the system from a certain viewpoint, for a certain category of stakeholders, and at a certain level of abstraction.
  • A Model is a Package.