Skip Navigation Links > Modeling > UML > Package

Package and Object diagrams


To simplify complex class diagrams, you can group classes into packages. A package is a collection of logically related UML elements. The diagram below is a business model in which the classes are grouped into packages.

Package and Object diagrams

Packages appear as rectangles with small tabs at the top. The package name is on the tab or inside the rectangle. The dotted arrows are dependencies. One package depends on another if changes in the other could force changes in the first.

Object diagrams show instances instead of classes. They are useful for explaining small pieces of the model with complicated relationships, especially recursive relationships.

This small class diagram shows that a university Department can contain lots of other Departments.

Recursive class diagram

The object diagram below instantiates the class diagram, by replacing it by a concrete example.

Object diagram

Each rectangle in the object diagram corresponds to a single instance. Instance names are underlined in UML diagrams. Class or instance names may be omitted from object diagrams as long as the diagram meaning is still clear.


Self test

Top-of-page | Use-Case | Class | Package | Sequence | Communication | State | Activity | Deployment