Packages and Package Diagrams - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Packages and Package Diagrams

Description:

It has no meaning to the execution ... Qualified names: Sensors::Vision ... Prefixed the name with a symbol ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 13
Provided by: ait3
Category:

less

Transcript and Presenter's Notes

Title: Packages and Package Diagrams


1
Packages and Package Diagrams
  • Keng Siau
  • University of Nebraska-Lincoln

2
Packages
  • A package is a general-purpose mechanism for
    organizing modeling elements into groups
  • It has no meaning to the execution
  • Well-designed packages group elements that are
    semantically close and that tend to change
    together
  • Loosely coupled and very cohesive
  • Graphically, a package is rendered as a tabbed
    folder

3
Packages
4
Names
  • Each package must have a name that distinguishes
    it from other packages
  • A name is a textual string
  • Two types of names
  • Simple names e.g., Business rules, Client
  • Qualified names SensorsVision
  • Package name prefixed by the name of the package
    in which that package lives

5
Simple and Qualified Names
6
Owned Elements
  • A package may own other elements
  • Classes, interfaces, components, nodes,
    collaborations, use cases, diagrams, and other
    packages
  • Ownership is a composite relationship
  • If the package is destroyed, the element is
    destroyed
  • Every element is uniquely owned by exactly one
    package

7
Owned Elements and Visibility
  • Visibility
  • Public element is visible to the contents of any
    package that imports the elements enclosing
    package
  • Prefixed the name with a symbol
  • Protected element can only be seen by children of
    that package
  • Prefixed the name with a symbol
  • Private element is not visible outside the
    package at all
  • Prefixed the name with a - symbol

8
Importing and Exporting
  • Two stereotypes
  • Import adds the contents of the target to the
    sources public namespace
  • Access adds the contents of the target package to
    the sources private namespace
  • The public parts of a package are called its
    exports

9
Importing and Exporting
10
Packages versus Classes
  • Classes are abstraction of things found in the
    problem or solution
  • Packages are mechanisms to organize things in the
    model
  • Packages do not appear in a running system
  • Strictly mechanisms to organize the design
  • If one is developing a trivial application, there
    is no need for packages

11
Modeling Groups of Elements
12
Example of a Package Diagram
Write a Comment
User Comments (0)
About PowerShow.com