define profiles and stereotypes
to verify structural and functional requirements, you must capture nonfunctional properties on elements in a system composer™ architecture model. to capture these properties, use stereotyping.
for example, if there is a limit on the total power consumption of a system, the model must be able to capture the power rating of each electrical component. to define component-specific property values requires extending built-in model element types with properties corresponding to requirements. in this case, an electrical component type as an extension of components is a stereotype. by extending the definition of regular components, you introduce a custom modeling language and framework that includes specific concepts and terminologies important for the architecture model. capturing the individual properties also sets the scene for early parametric analyses and to define custom views.
a stereotype is a custom extension of the modeling language. stereotypes provide a mechanism to extend the architecture language elements by adding domain-specific metadata.
apply stereotypes to model elements such as root-level architecture, component architecture, connectors, ports, data interfaces, value types, functions, requirements, and links. functions only apply to software architectures. you must have a requirements toolbox™ license to apply stereotypes to requirements and links. a model element can have multiple stereotypes. stereotypes provide model elements with a common set of property fields, such as mass, cost, and power.
a property is a field in a stereotype. you can specify property values for each element to which the stereotype is applied.
use properties to store quantitative characteristics, such as weight or speed, that are associated with a model element. properties can also be descriptive or represent a status. you can view and edit the properties of each element in the architecture model using the .
open the by navigating to modeling > property inspector.
a profile is a package of stereotypes that you can use to create a self-consistent domain of element types.
author profiles and apply profiles to a model using the . you can store stereotypes for a project in one or several profiles. when you save profiles, they are stored in xml files.
in this topic, you will learn how to:
create a profile and define stereotypes with properties.
define default stereotypes in a profile to be added to any new element in a model with that applied profile.
use stereotype-based styling that enhances the appearance of the model based upon specific features each element represents.
create a profile and add stereotypes
create a profile to define a set of component, port, and connection types to be used in an architecture model. for example, a profile for an electromechanical system, such as a robot, could consist of these types.
component types
electrical component
mechanical component
software component
connection types
analog signal connection
data connection
port types
data port
define a profile using the by navigating to modeling > profile editor. click new profile. select the new profile to start editing.
note
before you move, copy, or rename a profile to a different directory, you must close the profile in the or by using the function. if you rename a profile, follow the example for the function.
name the profile and provide a description. add stereotypes by clicking new stereotype. you can delete stereotypes and profiles by clicking the button in their respective menus.
note
to create requirement or link stereotypes, you need a requirements toolbox license. for more information, see (requirements toolbox).
save the profile. the file name is the same as the profile name.
add properties with stereotypes
select a stereotype in a profile to define it:
name — the name of the stereotype, for example,
electricalcomponent
.applies to — the model element type to which the stereotype applies. this option can be
,component
,port
,connector
,interface
,function
,requirement
, orlink
. you can apply this stereotype only to a model element of this type. the model element typefunction
is only available for software architecture models. for more information, see . the model element typesrequirement
andlink
require a requirements toolbox license.icon — icon to be shown on the model element with color, if applicable.
connector style — line style of the connector to be shown on the model with color, if applicable.
base stereotype — other stereotype on which this stereotype is based. this option can be empty.
abstract stereotype — a stereotype that is not intended to be applied directly to a model element. you can use abstract stereotypes only as the base stereotype for other stereotypes.
add properties to a stereotype using the button. define these fields for each property:
property name — valid variable name
type — numeric, string, or enumeration data type
name — name of the enumerated type, if applicable
unit — value units as a string
default — default value
add, delete, and reorder properties using the property toolstrip:
you can create a stereotype that applies to all model element types by setting the
applies to field to
define default stereotypes
each profile can have a set of default stereotypes. use default stereotypes when each
new element of a certain type must assume the same stereotype. system composer applies a default stereotype to the root architecture when you import the
profile. you can set this default as projectcomponent
in the using the stereotype applied to root on import
field.
this default stereotype is for the top-level architecture. if a model imports multiple profiles, the default component stereotype for all profiles apply to the architecture.
each component stereotype can also have defaults for the components, ports, and
connections added to its architecture. for example, if you want all new connections in a
project component to be analog connections, set analogconnection
as a
default stereotype for the projectcomponent
stereotype.
when you import the profile projectprofile
into a model:
the
projectcomponent
stereotype is automatically applied to the root architecture.the
electricalcomponent
stereotype is automatically applied to all new components in the architecture model.the
signalport
stereotype is automatically applied to all new ports.the
analogconnection
stereotype is automatically applied to all new connections.
use stereotype-based styling
profiles and stereotypes are used to apply custom metadata on the architecture model elements. element styling is an additional visual cue that indicates applied stereotypes.
you can use provided icons for the component stereotypes or use you own custom icon
images. custom icons support .png
, .jpeg
, or
.svg
image files of size 16-by-16 pixels. the custom icons are
displayed as badges on the components for which the stereotypes are applied.
you can associate a color with component stereotypes. element styling is an additional visual cue that indicates applied stereotypes.
use a preconfigured set of color options for component stereotypes to style the architecture component headers. see to learn how to use stereotypes in your model.
similarly, you can style architecture connectors using the stereotype settings. you can style connectors by using connector, port, or port interface stereotypes. customize styling provides various color and line style choices. connector styles are also reflected in architecture and spotlight views.
note
connector styling is sourced from the highest-priority stereotype that defines style information. connector stereotypes have the highest priority, followed by port stereotypes and then interface stereotypes. when two connectors with different styling merge, if the styling is incompatible, the resulting connector is displayed in black.
see also
| | | | |