Lesson 5: The Visual-Textual Hybrid in SysML v2
Precision and Synchronization
When engineers see SysML v2 for the first time, the reaction is almost always "Syntax Shock." You might find yourself thinking: "Wait, where are my diagrams? Do I have to become a programmer? Is MBSE just typing now?"
The short answer for v2: No. You do not lose your diagrams, and diagram-centric tooling and approaches are here to stay.
First, let's clear up a common misconception right away. One of the most fundamental concepts in SysML is that diagrams are only ever a view of the model, not the complete picture. In SysML v1, because models were authored almost entirely through drag-and-drop diagramming tools, the line between "model" and "view" often blurred for the user. Some users even found it confusing that hiding an element in a diagram did not actually remove from the model, because they thought the model and the view to be the same. The difference in SysML v2 is how this separation is formalized. Instead of relying on a tool's user interface to simply "hide" a box on a drawing canvas, SysML v2 builds the separation of model and view directly into the language grammar. In SysML v2, you formally define curated views using explicit language constructs: you expose a scope of the model, apply filters, and strictly render the results into an artifact (like a diagram or table). Consequently, both the textual code and the graphical diagrams are explicitly treated as co-equal projections of the underlying abstract model.
The Paradigm Shift: From "Drawing" to "Projecting"
In SysML v2, this separation isn't just theoretical; it's explicit in your workflow. The architecture enforces a strict, unbreakable separation between the data and the representation:
-
The Model (The Abstraction): This is the semantic data structure captured in the Abstract Syntax. However, it is important to remember that the model is not always the absolute "single source of truth". The true source of truth is often the documents from stakeholders. A model is a precise abstraction of those documents, whether textual or graphical.
-
The Notation (The Views): Both the textual syntax and the graphical syntax are explicitly defined as different renderings of the exact same underlying model.
-
The Rule of Context: Because models are abstractions, complex context information and reasoning often do not fit neatly into SysML elements. Good practice dictates that models should always be linked with natural language documentation, where the nuances and details of those design choices securely live.
The Hybrid Workflow (Split-Screen Engineering)
Modern SysML v2 environments such as SysModeler utilize a Visual-Textual Hybrid interface.
Imagine a dual-monitor setup:
- Left Screen (Text): You type part engine : Engine;
- Right Screen (Visual): Instantly, a "Part" box labeled engine mathematically renders in the diagram pane.
This combines the blazing speed of typing with the communication power of visual layouts. Tools strictly enforce synchronization based on the model semantics. If you write a line of code on the left, the diagram automatically updates on the right.
Example: Defining Topology in Code
SysML v2 standardizes how we define structure semantically. Let's look at how we connect parts and assert identities.
package SpacecraftSystem {
import ISQ::*;
port def DataPort;
part def Payload {
port dataOut : DataPort;
attribute mass : MassValue;
}
part def Bus {
port dataIn : DataPort;
}
part def Spacecraft {
attribute payloadMassBudget : MassValue;
part payload : Payload;
part bus : Bus;
// 2. THE CONNECTOR (Interaction / Flow)
// CORRECT SYNTAX: Uses 'connect' and 'to' keywords to define directed connections.
connection dataFlow connect payload.dataOut to bus.dataIn;
// 3. THE BINDING (Identity)
// SYNTAX: Uses the 'bind' keyword or '='.
bind payload.mass = payloadMassBudget;
}
}Code Overview: Here, we are defining the internal architecture of a Spacecraft. We start by declaring its internal parts: a payload and a bus. Then, we define how they relate using a connector to physically wire a data path between those parts, and we use a binding to mathematically link the payload's mass to our overall mass budget.
Critical Distinction Between Connector vs. Binding
In v2, we must be incredibly precise about the nature of a relationship. This is where v2 outshines v1 mathematically:
Connector (The Pipe / Wire):
part def Spacecraft {
connection dataFlow connect payload.dataOut to bus.dataIn;
}This code physically or logically wires a direct path for data (name: dataFlow) to travel from the payload (source: payload.dataOut) to the bus (target: bus.dataIn).
- Syntax:
connection <name> connect <source> to <target> - Meaning: Represents a physical or logical path for flow or interaction.
- Example: A copper wire transmitting voltage, a pipe moving fluid, or a network link passing data packets. Item A travels through this to get to Item B.
Binding (The Identity):
part def Spacecraft {
bind payload.mass = this.payloadMassBudget;
}This code mathematically asserts that the payload's physical mass (source: payload.mass) and the spacecraft's mass budget (target: payloadMassBudget) are the exact same property.
- Syntax:
bind <source> = <target> - Meaning: Asserts absolute identity. It means two usages refer to the exact same entity.
- Example: A logical sensor port on a software diagram is bound to the physical sensor port on the hardware diagram. It's like saying "Clark Kent = Superman." They aren't connected by a wire; they are literally the same thing viewed from different contexts.
The Visualization (The Result)
So, what happens when you type the code above? Tools read the abstract syntax derived from this text and auto-render a structural topology view:

- You will see a large boundary box (Spacecraft).
- Inside it, three smaller boxes appear (payload, bus and payloadMassBudget).
- Visualizing the Connector: A solid line (often with an arrowhead indicating direction) connects their respective ports, labeled dataFlow. This visualizes the physical or logical "wire".
- Visualizing the Binding: The tool will render a distinct binding line (standardized in SysML v2 graphical notation as a line with an = symbol in the middle) connecting payload.mass to payloadMassBudget. This visualizes that these two properties are the exact same things.
Why This is Better than v1
- Version Control for Diagrams: When diagrams are generated from the textual code, version control can track changes precisely at the code level. If a connector changes, you see the exact line of code that changed in a Git Diff.
- No More "Ghost" Elements: Model-driven views significantly reduce the risk of orphaned graphical elements. The Abstract Syntax enforces synchronization.
- Focus on Logic, Not Pixel-Pushing: You spend your mental energy defining how parts interact. Tools handle the "pixel pushing" (auto-layout) based on the semantic connections defined in the model.
V1 vs. V2 Cheat Sheet
Let's wrap up this lesson with a quick V1 versus V2 cheat sheet:
| SysML v1 | SysML v2 | |
|---|---|---|
| Authoring | Diagram-Heavy | Multi-Notation Authoring (Textual and graphical) |
| View Creation | UI- driven manipulations | Formally defined projections (Expose/Filter/Render) |
| Interchange & Management | XMI files only | XMI + JSON + SysML V2 API |
| Cross Connections | Allocation | Allocation (responsibility) and Binding (mathematical identity) |
That's how with both visual and textual representation SysML v2 enables better precision and synchronization.
Next Lesson
We are going to tackle the Static Structure. We will look at how to define the "Physical Architecture" (Parts, Attributes, and Item Flows) using the new v2 syntax to build the Skyzer drone.