Main Content

systemcomposer.interface.ServiceInterface

Client-server interface

    Description

    A ServiceInterface object describes the structure and attributes of a client-server interface.

    Creation

    Create a service interface using the addServiceInterface function.

    interface = addServiceInterface(model.InterfaceDictionary,"newServiceInterface")

    Properties

    expand all

    Dictionary of service interface, specified as a systemcomposer.interface.Dictionary object.

    Parent model of service interface, specified as a systemcomposer.arch.Model object.

    Service interface name, specified as a character vector or string. This property must be a valid MATLAB® identifier.

    Example: "newInterface"

    Data Types: char | string

    Elements in interface, specified as an array of systemcomposer.interface.FunctionElement objects.

    Universal unique identifier for service interface, specified as a character vector.

    Example: '91d5de2c-b14c-4c76-a5d6-5dd0037c52df'

    Data Types: char

    Unique external identifier, specified as a character vector. The external ID is preserved over the lifespan of the service interface and through all operations that preserve the UUID.

    Data Types: char

    Object Functions

    addElementAdd element
    getElementGet object for element
    removeElementRemove element
    setNameSet name for value type, function argument, interface, or element
    applyStereotypeApply stereotype to architecture model element
    getStereotypesGet stereotypes applied on element of architecture model
    getStereotypePropertiesGet stereotype property names on element
    removeStereotypeRemove stereotype from model element
    getPropertyGet property value corresponding to stereotype applied to element
    getPropertyValueGet value of architecture property
    getEvaluatedPropertyValueGet evaluated value of property from element
    setPropertySet property value corresponding to stereotype applied to element
    hasStereotypeFind if element has stereotype applied
    hasPropertyFind if element has property
    destroyRemove model element

    Examples

    collapse all

    Create a new model.

    model = systemcomposer.createModel("archModel","SoftwareArchitecture",true)

    Create a service interface.

    interface = addServiceInterface(model.InterfaceDictionary,"newServiceInterface")

    Create a function element.

    element = addElement(interface,"newFunctionElement")

    Set a function prototype to add function arguments.

    setFunctionPrototype(element,"y=f0(u)")

    Get a function argument.

    argument = getFunctionArgument(element,"y")
    argument = 
    
      FunctionArgument with properties:
    
          Interface: [1×1 systemcomposer.interface.ServiceInterface]
            Element: [1×1 systemcomposer.interface.FunctionElement]
               Name: 'y'
               Type: [1×1 systemcomposer.ValueType]
         Dimensions: '1'
        Description: ''
               UUID: '018b4e55-fa8f-4250-ac2b-df72bf620feb'
        ExternalUID: ''

    More About

    expand all

    Version History

    Introduced in R2022a