This training material encompasses the basic meta model for Software Component architectures. Examples and exercises are provided.
Suitable for class training or for self study.
Two hours to half-day course.
- Familiarity with SystemWeaver concepts such as Items, Parts and Attributes, and also with the GUI and common operations of the swExplorer.
- Knowledge of XML.
- Completed the Report Generation - Introductory Training.
- Completed the Meta Modelling Basics course.
- An installation of the SystemWeaver Architect (swArchitect).
- An installation of the SystemWeaver Explorer (swExplorer) which includes the SWExtension.ComponentGraph.dll extension. The extension is attached to this article if needed.
- A training server (If the course leader has not set up a server for the class, you can set up your own server by following the instructions in Setting up a Test Server).
- An installation of the Meta Model Training sqlite training database. See Database for Meta Model Training.
The exercises in this training consist of recreating the examples presented to create the meta models and then view the configurations in the Architect and Explorer clients.
In a component architecture, a connection is defined by a common signal, i.e., a connection between components involves one component having the signal as a send interface and another component having the same signal as a receive interface. Given this, additional meta model solutions will need to handle, for example, instances and reuse of existing fixed components that are not compatible with the current architecture. Autosar Design is a solution that handles this.
Basic Meta Model Illustration - Items and Parts
A software component meta model is illustrated as follows:
- Item types are displayed as boxes with the item type SID in the top-right corner (A)
- Part types are arrows with the part type SID written along side the arrow (B)
- Item type inheritance is illustrated with the item type residing inside the item type it inherits from (C)
- Abstract item type names are displayed in italic font (D)
In the Software Components architecture, the connection between two component items is defined by a common signal item type. The initial meta model would look something like this:
When you create the two item types in the SystemWeaver Architect application, the above meta model would appear as:
- Create the above item types in the Architect.
- The "Component" item will have two part types - "Send interface" (SEND) and "Receive interface" (REC). Create these part types in the Architect.
- Next, log into the Explorer client and create a component that has a send interface and a receive interface. Since both part types have signal as DefObj, both will have the same standard signal icon.
To increase the usability of the model, set different icons for the different part types in Architect:
Expanding the Model to Include A Design Function
To expand the model to encompass more than one component and be able to connect components to each other, add a design function to the model.
Later on in this training, we will look at expanding the model to cover several design functions.
- In Architect, add a design function item to the model.
- In Explorer, create a design function with two components in it.
- Create a signal that is sent from one component to the other
Tip: You can create the signal as send or receive on one of the components and then copy and paste it as send or receive on the other component so that you have one for send and one for receive.
Adding new Components and Interfaces via the Component Graph
The Component graph view is a graphical alternative for adding new components and interfaces. The representation offers clear semantics and user support allowing users to visualize and work with the model.
Note: Make sure that the component graph is included in your SystemWeaver installation. The SWExtension.ComponentGraph.dll file should be found in the swExplorerExtensions folder. If not, one is attached to this article.
Configuring the Component Graph
- Open the view configuration tool in Explorer by navigating to File > Configure the explorer.
- On the Item views tab, and select Component graph.
- Name the view using the Caption field.
- Enter a Group value to indicate in which menu group the view option will be located.
- Hint Header (for hovertip text title) and Hint text (for hovertip hint text) are optional.
- Click Edit configuration.
- The configuration that you would add to work with the meta model in this training is shown below. Copy and paste it into the Edit XML editor.
<Configs> <ComponentGraphConfig> <XmlAttribute attributeSid="ATRX" /> <Function itemSid="FUNC"> </Function> <Signal itemSid="SIG" /> <ContextPath/> <Context itemSid="FUNC"/> <SignalPaths> <SignalPath>/COMPS/SEND</SignalPath> <SignalPath>/COMPS/REC</SignalPath> </SignalPaths> <Components> <Component itemSid="COMP" partSid="COMPS"> <InPort partSid="REC" /> <OutPort partSid="SEND" /> </Component> </Components> </ComponentGraphConfig> </Configs>
The illustration below shows how the meta model and the configuration align.
Activating the Component Graph
In swArchitect, make sure to enable the Component graph by checkmarking Active.
In swExplorer, the view will now be available when users select a "Design function" item type in the structure.
To add components via the Component graph, select the component type to the right and drag it onto the graph.
Extending the Model to Cover Several Design Functions
The meta model can be extended to include several design functions by adding an architecture.
In the SystemWeaver Architect application, the above meta model would appear as:
And, in the Explorer application, it would appear for users as shown below:
Updating the Component Graph to Include Several Design Functions' Signals
The Signals pane in the Component graph view provides the designers with all of the signals that they can use. With the Component graph configuration applied earlier in this article, only the signals within the same design function will be available for selection.
To include other design functions' signals in the context of a design architecture, the configuration would need to be updated to include the context of the design architecture using the <ContextPath> tag:
- Change the configuration of the “Component graph” and restart the client.
In the Component graph view, the new context and the signals from the other design functions can now be seen:
Using an Abstract Component to Share Parts via Inheritance
One way to indicate that a signaling need should be realized by other design functions is to add external interfaces to the design functions. To achieve this, it's possible to share the send and receive parts between the design function and the component using inheritance. In other words, the meta model we would want to have would allow the design function and the component type to both inherit the same send and receive interface part types from an "Abstract component" type.
Creating the Abstract Type
In the SystemWeaver Architect application, start by creating an abstract item type named "Abstract component" with SID "ACOM". Be sure to checkmark Is Abstract.
Once the abstract item type is created, make this new abstract type the new owner of the send and receive interface part types by using the Change Part Type Owner tool on the Refactorings tab.
Once you Execute this, the results of the change will be visible when you select the new "Abstract component" type.
Next, change the Parent to “Abstract component” for both the “Design function” and “Component” types so that they can inherit the same parts.
Once you apply the inheritance change, you must log out and back in to see the new relationship in the Architect.
The same signals can now be added to the design function and the components as shown below in the structure tree.
The component graph, however, will not show the signals added to the design function until the configuration is updated to define this.
In the Component graph view, the signals connected to the design function can now be seen:
Using the Graphs View for Overview of Entire Architecture
To get a graphical overview of the entire architecture, the Graphs view can be configured as described in Creating Configurable Graphs - Introductory Training.
- Using the Graphs view, add the below graph definition. The resulting graph over the entire architecture is shown below.