Creating an example object model diagram

The following model shows how to use instance attribute values to take snapshots of a vacuum pump model at different stages in the lifecycle.

About this task

The vacuum pump removes the air from a chamber. The model needs to show the state of the system at various points in time, the initial value, the value after one hour, and the final value.

The following example shows the object model diagram for the model.

Object model diagram

To create a vacuum pump model as an example:

Procedure

  1. Create a package called ConstantPumping.
  2. Set the CG::Class::UseAsExternal property to Checked so the package is considered external (and code will not be generated for it).

    Alternatively, you can create a stereotype for the class («snapshot»), then set this property to Checked.
  3. In this package, each phase is represented by a different class. For the initial conditions, create a class called InitialConditions.
  4. Add a structure diagram to InitialConditions and add the elements (and their attribute values) to the diagram.
    Structure diagram
  5. To show the conditions after an hour, copy the InitialConditions class and rename it AfterAnHour. Specify the attribute values for this stage in the process. The following figure shows the attribute values after the pump has been running for an hour.
    Structure diagram showing the attribute values after the pump has been running for an hour
  6. To show the final values for the system, copy the InitialConditions class and rename it FinalState. Specify the attribute values for this stage in the process. The following figure shows the final values.
    Structure diagram showing the final values
  7. To show the order and transitions between snapshots, you can draw a simple object model diagram, as shown in the following figure.
    Object model diagram showing the order and transitions between snapshots

Feedback