Example: Using Things, Thing Templates or Thing Shapes
When do you use Thing Templates?
For example: If your company rents smart connected vehicles, you can create a Vehicle Thing Template by using the GenericThing Thing Template as the base Template. Based on the Vehicle Thing Template, create Car and Truck Thing Templates. Based on the Car Template, create an Electric Car Thing Template and an Internal Combustion Car Thing Template. Based on the Truck Thing Template, create a Tanker Truck Thing Template and a Refrigerated Truck Thing Template. Create individual Things that implement these Thing Templates. The following image illustrates this scenario:
When do you use Thing Shapes?
Thing Templates can implement 0, one or multiple Thing Shapes.
A company owns refrigerated trucks (based on a Truck Thing Template) and refrigerated vending machines (based on a Vending Machine Thing Template). These two entities have common properties such as operating temperature, capacity, power consumption, and heat output. Instead of defining this behavior twice, it is efficient to define it in a Refrigerated Unit Thing Shape. This Thing Shape can be reused by both entities.
How do Things, Thing Templates, and Thing Shapes work together?
The following image depicts how Thing Templates, Thing Shapes, and Things work together. Note the following points:
The VehicleTemplate Thing Template implements the system Thing Template, RemoteThing as the base template, and inherits the AssetShape and EngineShape Thing Shapes. As a result, the VehicleTemplate has all properties and services of the RemoteThing Thing Template and the AssetShape and EngineShape Thing Shapes.
The PassengerCarTemplate, TruckTemplate, and BusTemplate Thing Templates implement the VehicleTemplate Thing Template as the base template. As a result, they inherit all properties and services of the VehicleTemplate Thing Template.
The TruckTemplate and BusTemplate Thing Templates inherit the TrackerShape Thing Shape. In addition to the properties of the VehicleTemplate Thing Template, they have properties of the TrackerShape Thing Shape.
Things C1, C2, …., Cn implement the PassengerCarTemplate as the base template.
Things T1, T2, …., Tn implement the TruckTemplate as the base template.
Things B1, B2, …., Bn implement the BusTemplate as the base template.
Was this helpful?