Package Diagrams



index
Disabled back button Next Section
printable version




Section 0: Module Objectives or Competencies
Course Objective or Competency Module Objectives or Competency
The student will be able to assess and apply Object-Oriented analysis and design methods like use cases to express user requirements, UML modeling, and other OO approaches. Be able to create package diagrams.


Section 1: Overview

A package is a collection of logically related UML elements.

Video: When to Use Package Diagrams



Section 2: Dependency Relationship

A new relationship, the dependency relationship, is useful in package diagrams.

Syntax for Package Diagram.
dependency example.

What does a dependency relationship represent? In the UML diagram above the dependency means that class A uses class B, but that class A does not contain an instance of class B as part of its own state.


Dependency is a directed relationship which is used to show that some UML element or a set of elements requires, needs or depends on other model elements for specification or implementation.

dependency example.

Interpretation: CarFactory class depends on the Car class.


At the class level, there could be many causes for dependencies among classes. For example, if the protocol for a method is changed, then this causes the interface for all objects of this class to change.

Capturing dependency relationships among the classes and packages helps the organization in maintaining object-oriented information systems.


This video discusses the dependency relationship:



Section 3: Example

A simple package diagram, based on the appointment system example from the previous chapters, is shown in the figure below.

Package Diagram for the Appointment System.

By isolating the Problem Domain classes (such as the Patient and Appt classes) from the actual object-persistence classes (such as the Patient Table and Appt Table classes) through the use of the intermediate Data Management classes (Patient-DAM and Appt-DAM classes), the Problem Domain classes are isolated from the actual storage medium.



Section 4: Guidelines for Creating Package Diagrams

Use package diagrams to logically organize designs.

Observe semantic relationships.

Dependency relationships should also observe semantic relationships.

Use case package diagrams should include the actors.

Use simple but descriptive names for each package.

Make packages cohesive.



Section 5: Creating Package Diagrams

Set the context for the package diagram.

Cluster the classes together into partitions based on the relationships that the classes share.



Section 6: Verifying and Validating Package Diagrams

First, the identified packages must make sense from a problem domain point of view.

Second, all dependency relationships must be based on message-sending relationships on the communications diagram, cell entries in the CRUDE matrix, and associations on the class diagram.

Overview Package Diagram of 
			the PD Layer for the Appointment System.


Section 7: Resources