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.
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:
suspend
: This marks the shape or connection for deletionunsuspend
: 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
Show only connection to X
Show only likes
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.