Monday, June 5, 2017

Create an ORM diagram

Create an ORM diagram

The ORM Diagram template in Microsoft Office Visio includes all the shapes that you need to use the Object Role Modeling (ORM) method to capture business rules and to design databases. ORM is a semantic modeling approach that describes the world in terms of objects and the roles that they play.

ORM diagram example

  1. On the File menu, point to New, point to Software and Database, and then click ORM Diagram.

    Tip: Before you create an ORM diagram, organize your thoughts by writing down the information that you want the database to include. Use simple sentences to describe the objects that exist, how they are identified, and what roles they play.

  2. Add and name an object type (entity):

    1. Drag an Entity shape (to symbolize an object type) from ORM Diagram onto the drawing page.

    2. While the shape is selected, type the entity type's name.

    3. Press ENTER, and then type the entity reference mode in brackets.

  3. Add and name a value type:

    1. Drag a Value shape from ORM Diagram onto the drawing page.

    2. While the shape is selected, type the value type's name.

  4. Indicate a subtype:

    1. Drag a Subtype Connector shape from ORM Diagram onto the drawing page.

    2. Glue the end point End point image, which is plus sign in a green square to a connection point Connection point image - blue X on the subtype entity shape.

      The end point turns red, indicating that the connector is glued to the shape. You can move the glued shapes without breaking the connection.

    3. Glue the begin point Begin point image - green square with X inside (the arrowhead end) to a connection point Connection point image - blue X on the other entity type.

  5. Do one of the following:

    1. Indicate a relationship, role, or fact between the object types:

      1. Drag a predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary) from ORM Diagram onto the drawing page.

        Use a predicate shape that contains enough role boxes to relate all of the object types (entity shapes) that are involved in the relationship. For example, use a Ternary shape to indicate relationships among three entities.

      2. Drag a Role Connector shape from ORM Diagram onto the drawing page.

      3. Glue the begin point Begin point image - green square with X inside of the Role Connector shape to a connection point Connection point image - blue X on an object type (entity shape) for which you want to define a relationship.

        The begin point turns red, indicating that the connector is glued to the shape. You can move the glued shapes without breaking the connection.

      4. Glue the end point End point image, which is plus sign in a green square of the Role Connector shape to the appropriate role box on the predicate shape (from step 1).

      5. Double-click the predicate shape. Place the insertion point between ellipses (or placeholders), and then type a name for the role an entity type plays.

      6. Repeat steps 2 through 5 for each entity for which you want to define a relationship.

    2. Indicate a relationship, role, or reference between an entity and a value:

      1. Drag the Role Connector shape from ORM Diagram onto the drawing page.

      2. Glue the begin point Begin point image - green square with X inside of the Role Connector shape to a connection point Connection point image - blue X on an entity type (entity shape) for which you want to define a relationship.

        The begin point turns red, indicating that the connector is glued to the shape. You can move the glued shapes without breaking the connection.

      3. Drag a Binary or Vertical Binary shape from ORM Diagram onto the drawing page.

      4. Glue the end point End point image, which is plus sign in a green square of the Role Connector shape to the end of the Binary or Vertical Binary shape.

      5. Double-click the Binary shape to edit the text. Place the insertion point between ellipses or placeholders, and then type a name for the role that an entity plays.

        Tip: To move the ellipses and names on a Vertical Binary shape to the other side of the shape, right-click the shape, point to Shape on the shortcut menu, and then click Flip Horizontal.

  6. Show a nested object by creating an objectified predicate:

    1. Click the Drawing Tools button Button image to display the Drawing Tools toolbar, and then click the Rectangle  Button image tool.

    2. Draw a rectangle around the predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary) that you want to identify as an objectified predicate.

    3. Right-click the rectangle, point to Shape on the shortcut menu, and then click Send To Back.

    4. With the rectangle still selected, on the Format menu, click Corner Rounding, click the third option on the top row, and then click OK.

  7. Do one of the following:

    1. Indicate a mandatory role constraint:

      1. Drag the Mand. Role Connector shape from ORM Diagram onto the drawing page.

      2. Glue the begin point with the black circle Begin point image - green square with X inside to a connection point Connection point image - blue X on an object (entity shape).

        The begin point turns red, indicating that the connector is glued to the shape. You can move the glued shapes without breaking the connection.

      3. Glue the end point End point image, which is plus sign in a green square of the Mand. Role Connector shape to a predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary).

    2. Indicate a uniqueness constraint:

      1. Drag the Uniqueness Constraint shape from ORM Diagram onto the drawing page.

      2. Place the shape directly above or below the predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary) you want to constrain.

      3. Drag one of the end points ( Begin point image - green square with X inside or End point image, which is plus sign in a green square ) so that the arrow stretches across the appropriate role box on the predicate shape.

    3. Indicate a frequency constraint:

      1. Drag the Frequency Constraint shape from ORM Diagram onto the drawing page.

      2. Place the shape near the predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary) that you want to constrain.

      3. With the shape selected, type the frequency that you want.

    4. Indicate a set comparison or equality constraint:

      1. Drag the Subset Constraint or Equality Constraint shape from ORM Diagram onto the drawing page.

      2. Place the shape between the predicate shapes (Unary, Binary, Vertical Binary, Ternary, or Quaternary) with roles that you want to constrain.

      3. Glue the begin point Begin point image - green square with X inside of the Subset Constraint or Equality Constraint shape to a connection point Connection point image - blue X on the appropriate role box on the predicate shape.

        The begin point turns red, indicating that the connector is glued to the shape. You can move the glued shapes without breaking the connection.

      4. Glue the end point End point image, which is plus sign in a green square of the Subset Constraint or Equality Constraint shape to the appropriate role box of the other predicate shape.

    5. Indicate a ring constraint:

      1. Drag the Ring Constraint shape from ORM Diagram onto the drawing page.

      2. Place the shape near the predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary) containing the two roles that you want to constrain.

      3. Do one of the following:

        • If the two roles are part of a longer predicate, glue each end point ( Begin point image - green square with X inside and End point image, which is plus sign in a green square ) of the Ring Constraint shape to one of the roles on the predicate shape.

        • If the two roles are a binary predicate, select the Ring Constraint shape, and then on the Format menu, click Line. In the Pattern list, click None, and then click OK.

      4. Right-click the Ring Constraint shape, and then click the type of ring constraint you want on the shortcut menu.

    6. Indicate an external constraint:

      1. Drag an external constraint shape (Ext. Freq. Constraint, Ext. P Constraint, Ext. Mand. Constraint, or Ext. Uniq. Constraint) from ORM Diagram onto the drawing page.

      2. Place the shape near the predicate shapes that represent the roles that you want to constrain.

      3. From ORM Diagram, drag a Constraint Connector shape onto the drawing page.

      4. Glue the begin point Begin point image - green square with X inside of the constraint connector shape to a connection point Connection point image - blue X on the external constraint shape.

        The begin point turns red, indicating that the connector is glued to the shape. You can move the glued shapes without breaking the connection.

      5. Glue the end point End point image, which is plus sign in a green square of the constraint connector shape to the appropriate role box on the predicate shape (Unary, Binary, Vertical Binary, Ternary, or Quaternary).

      6. To change the frequency for the external constraint shape (Ext. Freq. Constraint, Ext. P Constraint, Ext. Mand. Constraint, or Ext. Uniq. Constraint), select the shape, and then type the frequency that you want.

  8. Save the diagram.

Top of Page

1 comment: