Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ThingModels and AppModels can inherit from model facets by using the keyword "combines".

Jira Legacy
showSummaryfalse
serverJIRA (mqidentity.atlassian.net)
serverId77fb3325-4051-36d9-bcc7-761f62050707
keyDOCS-18
 

To "Combine" is to include the definition by copy in place.

Combines can be used as a modifier to ThingModels and AppModels.

For example:

Code Block
languagexml
titleThingModel
linenumberstrue
<ThingModel#
ThingModel(Name=: "TempSensor", combines=: "TempFacetSerial"/>)

In this case, the ThingModel TempSensor definition will have all the structures (attributes and actions) defined as part of the TempFacetSerial.

One model can combine one or more model facets.

Code Block
languagexml
titleThingModel
linenumberstrue
<ThingModel#
ThingModel(Name=: "TempHumidity", combines=: "TempFacetSerial, HumidityFacetSerial">):
     <Sid name=Sid(name: "MySensorType" />
</ThingModel>)

Here two ThingFacets - TempFacetSerial and HumidityFacetSerial are combined and that will make TempHumidity to have attributes and actions from both ThingFacets.

Because only models can be instantiated, not model facets, model facets must be combined into a model for meaningful use at run time.