Combining model facets

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

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

For example:

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.

ThingModel
#
ThingModel(Name: "TempHumidity", combines: "TempFacetSerial, HumidityFacetSerial"):
     Sid(name: "MySensorType")

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.