SysML v2 Deep Dive 6 min read

Lesson 16: Composite vs. reference

Composite vs. reference: one word that can double your mass budget

SysML v1 drew whole-part relationships using diamond arrowheads . A filled black diamond denoted composite aggregation (ownership) . A hollow white diamond denoted "shared aggregation"—which the SysML v1.6 specification explicitly noted "defines no specific semantics or constraints" . Because the language left shared aggregation undefined, different teams and tool vendors interpreted the symbol in conflicting ways .

SysML v2 replaces that ambiguity with a single, mathematically rigorous distinction: Composite Usages vs. Reference Usages.

This distinction matters directly in real hardware design: ownership is a statement about physical containment . Get it wrong in a subsystem template by using composite part instead of ref part, and automated mass rollups will count parts that don't physically exist in that assembly.

The concept: who owns this?

A nested part is composite unless you say otherwise.

  • A nested part is composite by default (part): The whole owns the part instance . The part exists only while the whole exists, and no other whole can compositely own that same instance .
  • Adding ref makes it referential (ref part): The whole points to a part whose ownership and lifetime are managed elsewhere .
part def Spacecraft {
    part thruster : Thruster;               // Composite — the Spacecraft OWNS this instance
    ref part groundStation : GroundStation; // Reference — the Spacecraft POINTS TO this instance
}

The code: a satellite with one power bus

Our satellite has one power bus. Communications and thermal control both use it. Here is the version most people write first:

package SatelliteSystem {

    part def PowerBus;

    // Standard subsystem templates
    part def CommsSubsystem {
        part commsBus: PowerBus;       // A composite bus by default
    }

    part def ThermalSubsystem {
        part thermalBus: PowerBus;       // A composite bus by default
    }

    part def Satellite {
        // 1. DECOMPOSITION BY DEFAULT (Composite)
        // The one real physical power bus owned by the satellite
        part powerBus : PowerBus;

        // 2. THE MULTIPLICATION TRAP
        // Instantiating these subsystems as-is creates nested composite buses.
        part comms : CommsSubsystem;    // Instantiates a 2nd composite bus instance
        part thermal : ThermalSubsystem; // Instantiates a 3rd composite bus instance
    }
}

view def 'Part Structure View' {
    private import Views::*;
    filter @SysML::PartDefinition or @SysML::PartUsage;
    render asTreeDiagram;
}

view 'satellite structure view' : 'Part Structure View' {
    expose SatelliteSystem::**;
}

Count the buses: there is powerBus, then comms.bus, then thermal.bus. That's three physical buses. The model describes a completely different satellite from the one you intended to build, and an automated mass rollup will count two buses that don't physically exist.

The fix is to turn each subsystem's bus into a reference and point it at the real one:

package SatelliteSystem {

    part def PowerBus;

    part def CommsSubsystem {
        ref part commsBus: PowerBus;
    }

    part def ThermalSubsystem {
        ref part thermalBus: PowerBus;
    }

    part def Satellite {
        // The single real bus owned by the satellite
        part powerBus : PowerBus;

        // Instantiate the subsystems, overriding their internal buses
        part comms : CommsSubsystem {
            // Redefines the inherited 'bus' and binds it to the sibling 'powerBus'
            ref part :>> commsBus = powerBus;
        }

        part thermal : ThermalSubsystem {
            // Redefines the inherited 'bus' and binds it to the sibling 'powerBus'
            ref part :>> thermalBus = powerBus;
        }
    }
}

view def 'Part Structure View' {
    private import Views::*;
    filter @SysML::PartDefinition or @SysML::PartUsage;
    render asTreeDiagram;
}

view 'satellite structure view' : 'Part Structure View' {
    expose SatelliteSystem::**;
}

Read the fix one piece at a time. :>> bus replaces the inherited bus inside this subsystem. ref part makes it a reference. = powerBus ties it to the bus the satellite owns.

Now there's one bus, used by two subsystems, so it counts once in the mass budget. The subsystem definitions stay reusable, and the sharing is stated where the satellite is put together. I like that last part most. The decision lives where it belongs.

Deep dive: three things worth getting right

ref matters for occurrences, not attributes

Ownership applies to things that exist over time, which SysML v2 calls occurrences. Parts, items, actions, connections and ports are all occurrences. Nested ones are owned by default, so write ref when something is owned elsewhere.

ref part station : GroundStation; // A physical part owned elsewhere
ref item fuel : Fuel;             // A physical item you do not own

Attributes are different. They hold immutable Data Values (like numbers or physical quantities), not entities with an independent lifecycle. Attribute usages are always references, so ref attribute is legal but adds nothing.

attribute limit : MassValue;      // Inherently referential; no 'ref' needed

Ownership is a claim about lifetime

An owned part exists strictly within the lifetime of its whole. If the whole is destroyed, the composite part goes with it.

So ownership is wrong for anything the system borrows, shares or meets in its environment. A satellite doesn't compositely own its ground station, its orbit or its operator.

When you're unsure, ask one question: If the parent stopped existing, would this element stop existing too? If yes, use part. If no, use ref part.

A binding means equal, not assign

In most programming languages, = means "work out the right side and copy it into the left". A SysML binding has no direction. It says both sides are the same value. If one side is known, so is the other side.

// Declarative binding connector (bidirectional equality)
bind comms.powerIn = powerBus.powerOut;

// Inline binding shorthand on a feature
attribute actualMass : MassValue = calculatedMass;

SysML v1 supported this concept via the BindingConnector element, but it was largely confined to Parametric Diagrams and IBD value properties. In SysML v2, binding is a universal construct (bind / =) that applies uniformly across parts, ports, items, actions, and attributes anywhere in the model AST.

V1 vs. v2 composite and reference cheat sheet

ConceptSysML v1SysML v2
Owned partPart property, filled diamondNested usage, part engine : Engine;
Not ownedShared aggregation with no defined meaning, or a reference propertyref part station : GroundStation;
DefaultSet by the aggregation kind on each propertyNested occurrences are owned unless marked ref
AttributesValue propertiesAlways references, so ref is redundant
One part shared by subsystemsReference property, bound with a BindingConnector through nested connector endsref part :>> bus = powerBus; in context
Equality between featuresBindingConnector on a diagram= on the feature in textual notation, or a bind connection in diagram

Next Lesson

Metadata, the new stereotypes. In SysML v1, tagging a requirement as safety-critical meant building a profile first. SysML v2 does it with metadata def.

SysML v2

SysModeler Team

Engineering & Product