Internet of Things Patterns
This is an excerpt of the pattern that was first published in [1].

Device-Driven Model

Icon of the Device-Driven Model pattern

Device models, which describe the attributes and functionalities of particular types of devices, are created and stored on the device itself. The device supplies this model instance to its communication partners.

Aliases:

Client-side Endpoint Profile

Context:

You have devices that each offer a specific set of functionality to other components, such as operations that can be invoked on them (for example, operating an actuator, or restarting the device) or information that can be retrieved from them (for example, the most recent values of a sensor). Each device is also described by a set of metadata, which could include its name, type, id, manufacturer, etc. You have other components, like other devices, a backend server, an application, etc., that need to interact with these devices.

Problem:

Other components need to know the data and functionality which a specific device provides so that they can interact with it. But some use cases have a high diversity of devices and may work in a decentralized fashion.

Forces:

  • Compatibility: For other components to be able to interact with a device they have to somehow have a common understanding of the available functionality.
  • Flexibility: The abilities of a device might change through firmware updates. Other components have to be made aware of and adapt to these changes. This will be hard if changes have to be made on all other components, especially if changes have to be made by hand.
  • Diversity: Many different kinds of device with different functionality exist. Storing and managing descriptions of all of these devices centrally might be very hard.
  • Decentralization: Devices may want to communicate in a decentralized fashion, without any central component involved. Thus, using Server-Driven Models or Pre-Defined Device-Driven Models would not be possible.

Solution:

Let the developers of a device themselves define a model of the device. The model contains the device properties that can be read or written and the device commands that can be executed. Store the model on the device and make it available to other components that want to interact with the device.

Solution sketch of the Device-Driven Model pattern

Solution Details:

This is an excerpt of a previously published pattern. The full pattern can be found in [1].


Benefits:
Drawbacks:

Variants:

Related Patterns:

Known Uses:

  1. L. Reinfurt, U. Breitenbücher, M. Falkenthal, F. Leymann, and A. Riegg, “Internet of Things Patterns for Device Bootstrapping and Registration,” in Proceedings of the 22nd European Conference on Pattern Languages of Programs (EuroPLoP), New York, NY, USA, 2017. Available at https://dl.acm.org/citation.cfm?doid=3147704.3147721