O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining the node topology

The node topology is basically the way nodes are connected, or related, to each other in the data source. There are two typical relations that need to be defined: a node's parent and a node's children. If the node does not have a parent, it's a root node. If it lacks children, it's a leaf node. All nodes with the same parent node, are called sibling nodes. In our example, our nodes are both parent nodes and leaf nodes:

public IThingReference Parent => null; 
public bool HasChildren => false; 
public bool ChildrenOrdered => false; 
public Task<IEnumerable<INode>> ChildNodes => null; 

The topology is managed using a set of methods defined by INode. Since we have a static topology, these methods will respond in the negative, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required