Skip to main content

Define metamodel

Overview

A metamodel defines the structure and relationships of an entity. By defining a metamodel, you can formalize what you need to design and the constraints that you should consider when designing.

In the following, the theme is a use case model consisting of actors and use cases. Here are the basic steps for creating a new profile and defining a metamodel.

Image of metamodel to define

Metamodel definition

About the overall structure of the metamodel

Since Next Design can handle various models related to the product in one project, the number of models in the project is large. Therefore, it is useful to have a hierarchical structure that allows you to roughly classify the types of models directly under the project.

In the following, we will define the metamodel so that the project has the following hierarchical structure. In this project example, [Requirement model] and [Design model] are provided directly under the project, and the types of models are roughly classified.

Project model structure example

Also, expanding the scope of your project will increase the number of metamodel components defined in your profile. Therefore, it is useful to have a package for each model type to classify the components of the metamodel. This makes it easier to get a bird's eye view of the overall composition of the metamodel.

In the following, we will provide a Use Case Model package to define the metamodel as follows: In this profile example, the Use Case Model package is provided directly under the root of the profile to classify the components of the metamodel.

Add Package to Profile

Advance preparation

Understand the screen configuration

When defining a metamodel, use the profile navigator on the left, the class diagram in the center, and the inspector on the right.

Metamodel editing screen configuration

To open the class diagram in the center, double-click the class diagram you want to open in the Profile Navigator. To close the class diagram, click the x icon that appears in the upper right corner of the class diagram.

note
  • Unlike the model editor, the display of the class diagram does not change even if the selected node is changed by clicking the tree node in the profile navigator.
  • To view another class diagram, double-click to open the class diagram you want to view.

In the following, let's define a metamodel of the use case model in the following steps.

  1. Add use case model to profile
  2. Define the structure of the use case model

1. Add use case model to profile

To add a use case model metamodel to your profile, do the following:

  1. Create a project for a new profile
  2. Configure a profile to add a Use Case Model entity
  3. Prepare a class diagram to define the [Use Case Model] metamodel

1.1 Create a new project

Create a project for a new profile

To create a project for a new profile, follow the steps below to create a new project.

Create a new profile

Operation procedure
  1. Launch Next Design and click the Start> Create New Project link from the Start Menu.
  2. In the [Create New Project] dialog, enter the [Project Name], do not specify the [Profile], and click the [Create] button to create a new project.

Switch to screen configuration for metamodel definition

To switch to the screen configuration for metamodel definition explained in the preparation, follow the procedure below.

Metamodel definition screen configuration

Operation procedure
  1. Select Profile Navigator from the selector at the top of the navigator to switch between navigators.
  2. Click View> Pane> Inspector on the ribbon to display the Inspector on the right side of the screen.

1.2 Configure profile

Add the entity directly under the project

In order to roughly classify the model types directly under the project, add the [Request Model] entity in the following procedure.

Add Entity Directly Under Project

Operation procedure
  1. Right-click [Project Definition Sample] displayed at the top of the profile navigator, and click Click Add> Metamodel> Entity from the context menu.
  2. In the [New Entity] dialog, enter the items as shown in the table below and click the [OK] button.
ItemValue
[Display Name]Enter "Request Model" as the name
[Class Name](The same name as the display name is automatically entered)
[Icon]Select an icon from the options

Changed definition so that it can be placed directly under the project

Entity that can be added directly under the project in the model navigator at the time of modeling is limited to a specific entity. To be able to add the [Request Model] added in the previous step directly under the project, change the definition in the following step.

Allow placement directly under the project

Operation procedure
  1. Select Request Model in the Profile Navigator to view the details in the Inspector.
  2. Check Allow deployment directly under the project in the Inspector.

Provide a package and add a [Use Case Model] entity

To create a package in your profile and add a Use Case Model entity, do the following:

Add use case model

Operation procedure
  1. Right-click [Project Definition Sample] displayed at the top of the profile navigator, and click Click Add> Package from the context menu.
  2. Right-click the added package, click Rename from the context menu, and rename it to Use Case Model.
  3. Next, click [Add]> [Metamodel]> [Entity] from the context menu of the package.
  4. In the [New Entity] dialog, enter [Use Case Model] in [Display Name], select [Icon], and click the [OK] button.

1.3 Prepare a class diagram that defines the metamodel

Added class diagram to [Use Case Model]

To define the Use Case Model metamodel in UML class diagram format, add a class diagram as follows:

Add class diagram

Operation procedure
  1. Right-click the Use Case Model package on the Profile Navigator and click Click Add Class Diagram from the context menu.
  2. Enter Use Case Model Structural Diagram as the name of the class diagram added on the profile navigator.

Configure parent-child relationship for [use case model]

In order to create a model hierarchically at the time of modeling, it is necessary to connect the entities that correspond to the parent-child relationship in the ownership relationship.

To be able to add a Use Case Model under Request Model when modeling, follow these steps to establish an ownership relationship.

Configure parent-child relationship

Operation procedure
  1. Double-click Use Case Model Structure Diagram to open the class diagram.
  2. Drag and drop the Request Model and Use Case Model from the Profile Navigator to add them to the class diagram.
  3. To make an association, move the pointer to the parent Request Model, drag the โ–ฒ icon that appears in its four directions, and drop it on the Use Case Model that you want to associate.
  4. When you drop it, a related type of choice will pop up, and you can select it by clicking Embedded.
  5. This establishes an ownership relationship from the Request Model to the Use Case Model and defines a parent-child relationship between the Request Model and the Use Case Model.

2. Define the structure of the use case model

To define the structure of the Use Case Model, add and associate the Actor and Use case entities in the class diagram. The procedure is as follows.

  1. Add Actor and Use case as entities.
  2. Add a field to the entity.
  3. Associate the entities to define the structure of the Use Case Model.

2.1 Add entity

To add an entity to your class diagram, do the following:

Add Entity

Operation procedure
  1. Drag and drop [Entity] from the Class Toolbox to add it and enter a name.
  2. Here, add [Actor] and [Use case] as entities.
Attention
  • If you select an entity and press the delete key, it will only be hidden on the class diagram and will not be deleted from the metamodel, similar to the [Delete From Diagram] in the context menu. , It also remains on the profile navigator.
  • If you want to delete an entity that you added by mistake, execute [Delete Model] from the context menu of the entity.

To change the icon of the added entity, follow these steps:

Change Entity Icon

Operation procedure
  1. Select the entity whose icon you want to change in the class diagram.
  2. Select the icon in the Inspector.

2.2 Add field to entity

To add a field to hold data in an entity, do the following:

Add Field

Operation procedure
  1. Move the pointer over the entity in the class diagram.
  2. Click the + icon that appears at the far right of Filelds. Here, add the Preconditions field (string type) to the Use case entity as follows:
  3. In the [Add New Fields] dialog, enter the items as shown in the table below and click the [OK] button.
ItemValue
[Display Name]Enter "Precondition" as the name
[Field Name](The same name as the display name is automatically entered)
[Data Type]Select [String] from the choices

2.3 Associate entities to define structure

To be able to add another entity as a child element that makes up one entity, make an ownership relationship that represents the parent-child relationship between the entities.

Also, to be able to associate entities with relationships other than parent-child relationships, such as Actor and Use case, connect reference associations between the entities.

Here, the following two types of associations are defined as the structural definition of [Use Case Model].

RelationshipDescription
Ownership related from [Use Case Model] to [Actor] and [Use case]You can now add [Actor] and [Use case] to the children of [Use Case Model].
Reference association from [Actor] to [Use case]You can now associate [Actor] with [Use case].

Associate Entity

Operation procedure
  1. Move the pointer over the entity from which it is related.
  2. Drag the [โ–ฒ] icon that appears in four directions and drop it on the related entity.
  3. A related type of choice will pop up, click to select.
Attention
  • Similar to deleting an entity, if you select a related line on the class diagram and press the delete key, it will only be hidden on the class diagram and will not be deleted from the metamodel. , It also remains on the profile navigator.
  • If you want to delete an accidentally added association, run Delete From Model from the context menu of the association line.