본문으로 건너뛰기

Models

Let's say you want to define all models and relationships between models once, then display them in different ways.

First, let's define the models and relationships.

RestaurantsDinersChipotleChick-Fil-ABurger Kingdanielzack competes witheat atlikesdislikeslikeslikes

We will use this as the example for multiple views of the same model. How do we treat these as models and not just ordinary shapes and connections? We use the following keywords:

  1. suspend: This marks the shape or connection for deletion
  2. unsuspend: This restores the shape or connection

Since models are meant to be invisible until used, we define models at the top of our diagram and suspend all of them with the following globs.

We then use globs to selectively unsuspend the models we want to show. Let's take a look at some use cases.

정보

If you haven't yet, please familiarize yourself with globs.

Show only top-level

RestaurantsDiners eat at

Show only connection to X

RestaurantsDinersChipotleBurger Kingzack competes withlikes

Show only likes

RestaurantsDinersChipotleBurger Kingdanielzack likeslikeslikes

Utilizing imports

As you may have noticed, each of these examples repeated the initial models. You can further apply the "one model" principle by defining models once in their own file and importing them. See the import model-view pattern for more.