🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
MDrivenStart Diagrams
This page was created by Hans.karlsen on 2020-07-09. Last edited by Wikiadmin on 2026-07-29.

You can use diagrams in MDriven Designer to create focused visual views of your model for modeling, navigation, and documentation.

What a diagram shows

A diagram is a visual representation of selected model elements. It is not the model itself.

A class belongs to the model repository and lives in a package. You can place a representation of that class on any number of diagrams without creating duplicate classes.

For example, you might use:

  • A Customer overview diagram that shows Customer, Order, and their relationship.
  • An Order details diagram that shows Order, OrderLine, and only the attributes needed when discussing order handling.
  • A technical diagram that also shows methods or additional associations.

Each diagram can contain any number of classes, including no classes. You can create as many diagrams as your model needs.

Add and open a diagram

Diagrams appear in both the overview and the repository tree.

  1. Create or select a diagram in the overview or repository tree.
  2. Change its name in the Object Inspector when you need a meaningful name. For example, rename Diagram2 to Order handling.
  3. Double-click the diagram to enter it.
  4. Return to the overview by using the back arrow, or select another diagram in the repository tree.

The Object Inspector also exposes diagram properties that control diagram behavior. Use these properties when you need that level of organization and control.

Add classes to a diagram

You can create a new class from a diagram or place an existing class on it.

Create a class from the diagram

  1. Enter the target diagram.
  2. Right-click an empty area of the diagram.
  3. Choose Add a class.
  4. Give the class a name, such as Order.

The new class is added to the model repository and shown on the diagram where you created it. For information about class properties, packages, persistence, and default string representations, see MDrivenStart:MDrivenStart Class.

Place an existing class on another diagram

  1. Find the class in the repository tree.
  2. Drag the class onto the target diagram.
  3. Arrange the class representation for the purpose of that diagram.

Dragging Order onto a second diagram does not move it from the first diagram and does not create a second Order class. Both diagram symbols represent the same class in the model.

Choose what each diagram communicates

Show the parts of a class that help the reader understand the current subject. A diagram can show or hide class attributes, associations, and methods independently of other diagrams.

For example, on an Order overview diagram, show the Order class and its association to Customer, but hide implementation-oriented methods. On an Order pricing diagram, show OrderLine attributes that explain quantity and price.

Associations describe how classes relate. Add or change these relationships from MDrivenStart:MDrivenStart Associations.

Remove a class from a diagram without deleting it

You can remove a class representation when it no longer belongs in a particular view. This removes it from that diagram only; the class remains in the model repository and on any other diagrams where it is shown.

For example, if Customer makes an Order pricing diagram too crowded, remove its representation from that diagram. The Customer class still exists and remains available to drag onto the diagram later.

Organize diagrams with categories

Use categories to group diagrams by purpose or importance.

  1. In the repository tree, choose Add a category.
  2. Name the category, for example Important or Less Important.
  3. Set the category on the relevant diagrams.

A category has a name and can help you distinguish diagrams that are central to the model from diagrams used for supplementary documentation.

Use diagrams for navigation and documentation

A diagram can include other diagrams as visual navigation aids. Drag a diagram onto another diagram to show it as a thumbnail representation. This helps you build an overview diagram that leads readers to more detailed views.

For example, create a top-level Sales diagram, then place thumbnails for Customer management and Order handling on it. A reader can use the overview to understand how the detailed diagrams are organized.

For more detail on working in the Designer overview, including diagrams in diagrams, see Documentation:MDriven designer overview Part 1 and Documentation:Diagrams in Diagrams.

Other diagram types

MDriven Designer also has diagram types for different modeling purposes.

Diagram type Use Example
Class diagram Show classes and the selected attributes, associations, and methods that explain a part of the model. Show Customer, Order, and their association.
Process diagram Document a workflow or the order in which work happens in the domain. Create a process named Fetching Mail with steps such as GoToPostOffice, TalkToLady, and GoHome.
State diagram Define the allowed states and transitions for a StateMachine attribute. Define the states through which an object can move as its state changes.

A state diagram is created when you add a StateMachine attribute. It defines the allowed state values, transitions, guards, and actions on state entry. Learn how to model states in MDrivenStart:MDrivenStart StateMachines.

Keep the model valid

Diagrams are views of the model, but the underlying model must remain valid before you run or deploy it. Validate the model and resolve errors before starting the Prototyper or deploying. See MDrivenStart:MDrivenStart Verify.

See also