Declarative means you are not writing “functional” or “procedural” code to do something. Instead, you are declaring what you want to happen.
The main example of a declarative approach within Prism is Prism View. For example, instead of writing code that tells the browser how to draw a bar graph, the UI/UX person that is developing the UI part of the solution declares how they want that bar graph to appear. They are saying, “I want a bar graph, I want it to be here, I want it to be this size, I want it to use these colors, I want it to have these labels, I want it to pull from this data.” That’s what declarative programming is. You are declaring what you want to happen, you are not writing software to make it happen. The advantage is that it’s faster to develop, it’s less error-prone, and it’s easier to maintain over the life-cycle of the application.
Another example is our Binary Schema module, used to decode packed binary data payloads, typically received from sensor nodes. While it runs in Prism Core and Edge, which are not declarative environments, the process of building a payload decoder with the Binary Schema module is itself declarative. So instead of writing code that procedurally extracts data from the binary payload (which can quickly turn into some real spaghetti code), the developer simply declares the desired result: data in the form of meaningful named properties. And as with Prism View, this approach is faster to develop, less error-prone, and much easier to maintain and modify.All FAQs