Use Well-known Names and Types for Common Concepts
Throughout all QDMs, we strive to have similar information and concepts represented in a similar way. This reduces the amount of effort needed to understand a "new" data model, and makes data models more self-documenting.
At Type Name Level
Concept | Convention |
---|---|
Type/Topic naming for Directed State Pattern (see State versus Event) |
|
At Type Member Level
Concept | Convention |
---|---|
Unique ID as topic key |
|
Reference to an instance on another topic |
|
Date/time value |
|
Duration/time interval |
|
IPv4 address |
|
IPv6 address |
|
Ethernet MAC address |
|
Representing Non-Integral Quantities
Where possible, avoid the use of floating point numbers in data models. Qeo is targeted to run on embedded platforms, which typically have limited or no hardware support for floating point calculations. If feasible, choose a fixed-point representation with known precision, and use an integral type to represent your quantity.
For physical quantities, use the SI unit prefixes (milli, micro, mega, ...) to denote the precision of your field.
Representing Physical Quantities
Do not allow individual publishers of a data model to choose the unit in which a given physical quantity is represented. State the physical unit, and its precision, upfront in the QDM. Where possible, stick to SI units, and use an integral type to represent the quantity with a known precision (e.g. magnetism in nanoTesla, length in millimeters, ...).
Representing Enumerations
Often, your data model will contain information that's really best modeled as an enumeration (the state of a Finite State Machine, the wifi channel your access point is operating on, ...).