Context is a method of storing data in a hierarchical manner. The data used by the component or a view are stored in the form of context. We can read or write data in the context using the controller as a starting point.
Structure of a Context node:
If you look at the context tab of any controller you will be able to see a thing called context. It is actually a singleton root node under which we will be declaring our nodes and attributes.
Each context has a node and a number of attributes underneath a node. The attributed declared directly will be coming under the root context node “CONTEXT”.
Each node consists of data can be one of the two ways:
We will discuss it when we come to the topic cardinality of the context node.
Recursion Node:
Dynamic nesting of the node is also possible within the context called recursion node.
How to access the data in the context?
By default, all the nodes which we are declaring will be the child node of the root node “CONTEXT”. The reference to this root context is available in the Attributes tab of the Controller.
The interface consists of a number of methods that will help us play with the context.