Which SysML v2 Element to Choose?
It is not always easy to decide what is the best choice.
The taxonomy in SysML v2 is significantly more complex than in SysML v1. This gives modelers more control in deciding what kind of thing they want to model – but only if they know what the different keywords mean. Attributes, items, parts? What is an Occurrence? Here is some help to decide which one to use. These are guidelines and not hard rules specified by SysML v2. It is often up to the modeler to decide whether a thing is modeled as a part or an item, for example.
Taxonomy of some SysML v2 Model Elements
Some of the model element types are explained in more detail below, and a table with a brief overview is provided first for the impatient.
What do you want to model? | Which is a good model element choice? |
Something like an interaction in SysML v1 | Occurrence |
Something that flows through the system, such as a signal. | Item |
Parts of a system, such as mechanical, electrical, software, etc. components. | Part |
Interaction point of a part (what is sometimes called interface, but the interface has a different meaning in SysML v2) | Port |
Data, such as numbers, dates, and strings. | Attribute |
Something that would be modeled with a UML class, i.e., that represents information. | Item |
Occurrences
SysML v2 introduced the concept of “4D modeling”. This means that our models can describe things existing in space and time, as well as the temporal and spatial relationships between them. Not everything exists in space and time, as we will see with Attributes. However, when they do, they are modeled as some kind of Occurrence. Occurrences occur in 4D. They also have an identity, which means that they can be different things even if they look the same. An occurrence definition or usage is the most generic kind of thing existing in 4D, generalizing structure and behavior – there is a good chance you will never need to declare one. In existing examples, they are mostly used to model interactions – which are not items, ports, or actions.
Items
Items are primarily spatial occurrences that can be passed between components or acted on by systems. Whenever we use signals in SysML v1, an item is probably the best choice in SysML v2. Items generally do not have complex internal behavior or ports, although they can, and many times, parts are treated as items for some period during their existence. For example, an engine can be treated as an item during manufacturing when handed over to different stages of assembly in the factory but will be a part when it is finally placed into a car. Use an item definition when you need something like a signal, and feel free to use an item usage even if you expect the value to be a part.
Parts
Parts are kinds of items that represent “a modular unit of structure such as a system, system component, or external entity that may […] interact with the system”. They usually have some kind of behavior, ports, subparts, and all the complexity associated with structure modeling.
Remember that parts are items, so they can also be sent to other parts or acted on just like items. You may even assign a part to an item or bind them. As a rule of thumb, use parts when you decompose the system (they are called parts for a reason) and items when you model objects used by your system.
Ports
In SysML v2, ports are not the same kind of things as parts. Instead, they have their own branch of occurrences. SysML v2 ports are like proxy ports in SysML v1. Declare them inside parts to define their interaction points and use items or attributes inside the ports to model what is exchanged through the port.
An interaction point of a part is also sometimes called the part’s interface. However, interfaces have a different meaning in SysML v2. The SysML v2 Interface is a kind of connection whose connection ends are ports.
Attributes
Attributes are significantly different from occurrences. Attributes exist outside of space and time. They do not have a position or a lifetime. They just exist in a conceptual space that is in our minds. They are primarily data types, such as Integer or List. They do not have identity either, meaning that the number 5 is exactly the same abstract concept everywhere you see it. We use attributes when we model information (but not representations of it!) or characteristics of other things.
When transferring information, we generally use items to model “physical” representation, such as a data packet or a software class representing customer details. The customer details, such as name or address, are themselves modeled as attributes, and an item representing the message can wrap them to model the occurrence of that information.
Soon there will be more from us on SysML v2. We are currently writing a textbook on SysML v2, which will be published in 2025. Stay tuned!