How SysML v2 handles Composition and Specialization
Hey everyone. I have been putting together some visual breakdowns on the transition to SysML v2, and I wanted to share a look at how the new standard handles the Parts Tree.
In SysML v1, showing that a system owned a part meant drawing a composite association, which was a line with a solid black diamond on the parent side. Doing this at scale often turns block definition diagrams into unreadable spiderwebs.
SysML v2 preserves the graphical notation, but it introduces a perfectly equivalent textual notation where ownership is established simply by nesting elements inside curly braces. When an element is declared within the body of a namespace, it automatically establishes an owning membership relationship.
Here is a quick look at how you define a specialized vehicle configuration. Notice the strict distinction between subclassification (a definition inheriting from a definition) and subsetting (a usage inheriting and restricting a usage):
Code snippet
package VehicleHierarchy {
part def Engine;
part def V8_Engine :> Engine;
part def Wheel;
abstract part def Vehicle {
abstract part engines: Engine [1..*];
abstract part wheels: Wheel [2..*];
}
part def SportsCar :> Vehicle {
part carWheels: Wheel [4] subsets wheels;
part mainEngine: V8_Engine subsets engines;
}
}
By using the subsets keyword, we are asserting that mainEngine is a specific subset of the inherited engines collection. This narrows its allowed type to V8_Engine while still obeying the structural rules of the abstract base.
When loaded into a compliant v2 tool, this text code directly generates the visual Tree View, meaning your code structure and your model structure are the exact same thing.
I have attached the video explanation above for those interested in the visual breakdown. For those already experimenting with the v2 pilot, do you prefer this text-first nesting approach over manually routing composite lines?