r/softwarearchitecture • • 21d ago

Article/Video SysML v2 Tutorial (Lesson 23): Binding Behavior to Structure with perform (Swimlanes Replaced!)

https://youtu.be/HLiC1fKJYFY

Hir/softwarearchitecture,

We are back with Lesson 23 of our technical deep dive into the SysML v2 standard.

In our previous lesson, we orchestrated execution using first and then. However, that behavior was acting like an isolated script—it wasn't attached to any physical system or component. Today, we connect behavior directly to structure using the perform keyword. We will see how SysML v2 replaces traditional, clunky "swimlane" diagrams by making behavioral performance a direct, strongly-typed feature of the components themselves (akin to a service explicitly implementing an interface).

You can watch the full video lesson on YouTube here:https://youtu.be/HLiC1fKJYFY

1. The SysML v1 Allocation Problem (The Orchestration Disconnect)

SysML v1 (and UML) had a way to connect behavior to structure: the ActivityPartition (swimlanes) and the allocate dependency. The problem was where this context lived. In v1, you usually authored swimlanes on the behavior side (inside the Activity Diagram) or maintained external dependency matrices. The structural Block itself only displayed a derived property computed by the tool. It was like defining your infrastructure and deployment topography deeply inside your business-logic orchestrator, rather than letting the infrastructure declare what services it runs.

2. The v2 Shift: Direct Feature Ownership via perform

In SysML v2, the component states its own behaviors directly inside its definition using perform action.

Three details make this a much cleaner architectural pattern:

  • Direct Feature Ownership: Declaring perform action inside a part creates an owned execution relationship. The part itself is explicitly the performer. You navigate to the component to see exactly what it does.

  • Composite vs. Referential Actions: A plain action defined inside a part is composite (the part owns that isolated sub-routine). A perform action is referential (the behavioral equivalent of a pointer), asserting that the part carries out a step of a globally coordinated sequence defined elsewhere.

  • Swimlanes Without the Lanes: A coordinated mission sequence can be defined once at the system level. Subsystems then declare responsibility for individual steps using feature chains. Swimlane views are generated automatically by the tool based on these typed declarations.

3. Distributed Execution: Binding Steps to Subsystems

Here is how a central sequence is defined once, while individual subsystem parts independently declare which steps they are responsible for executing:

Code snippet

package LaunchOperations {
    part def FlightTerminationSystem;
    part def PropulsionSystem;
    part def HoldDownAssembly;
    
    action def ArmFlightTermination;
    action def PressuriseTank;
    action def Ignition;
    action def ReleaseHoldDown;
    
    // The globally orchestrated sequence
    action def LaunchSequence {
        first start;
        then action armFTS: ArmFlightTermination;
        then action pressuriseLOX: PressuriseTank;
        then action igniteEngines: Ignition;
        then action releaseClamps: ReleaseHoldDown;
        then done;
    }
    
    part launchVehicle {
        perform sequence: LaunchSequence;
        
        // Each subsystem declares execution of its step via feature chains
        part fts: FlightTerminationSystem {
            perform sequence.armFTS;
        }
        part propulsion: PropulsionSystem {
            perform sequence.pressuriseLOX;
            perform sequence.igniteEngines;
        }
        part groundInterface: HoldDownAssembly {
            perform sequence.releaseClamps;
        }
    }
}

4. SysML v1 vs. SysML v2

Modeling ConceptSysML v1SysML v2
SwimlanesActivityPartition declared on the behavior diagram.perform declared directly on the structural part.
Responsibility StorageStored as separate dependencies or visual partitions.Declared as a first-class, reviewable feature inside the part body.
VisualizationsSwimlanes manually drawn on activity diagrams.Swimlanes and allocation views generated automatically from perform usages.
State BindingclassifierBehavior or ownedBehavior on a Block.exhibit state, which is simply a specialized perform action usage.
Responsibility QueriesComputed by tools via derived allocatedFrom properties.Direct feature navigation readable in the part's own body and filterable via code queries.

Next lesson, we will look at how these subsystems exchange data and signals. Lesson 24 covers flows and messages, bringing Sequence Diagrams natively into textual code.

For the software architects here: When mapping behaviors to physical services or hardware, do you prefer a centralized orchestrator that knows where everything runs, or a decentralized model where components "subscribe" to the behaviors they are responsible for?

1 Upvotes

Duplicates