|
|
|
Re: Benefits of XML/XSL rules/templates [message #1717548 is a reply to message #1717537] |
Mon, 14 December 2015 16:27 |
John Cocula Messages: 21 Registered: June 2015 |
Junior Member |
|
|
Quote:I think there is a lot of dispute whether or not XML is a superior format over JSON.
Of course the answer depends on the surrounding components, and for REST and UIs I imagine JSON is just simpler to deal with. And the last thing I want to do is flame about this format vs. that format.
I wanted to draw attention to the rich set of XML tools that have been around longer than JSON for validating and transforming structured information, and why there is value in leveraging those things instead of rolling out a custom templating/transformation engine, or hand-validating structural correctness. One could achieve a lot more openness, I believe, by using these tools instead of hand-rolling domain-specific workalikes.
Quote:
Note that we created an architecture that allows for other serialization formats as well - all you would have to do is to implement an implementation for this interface:
https://github.com/eclipse/smarthome/blob/master/bundles/automation/org.eclipse.smarthome.automation.api/src/main/java/org/eclipse/smarthome/automation/parser/Parser.java
I had read that interface and it seems some what tied to JSON already, in that this line of the interface has a hardcoded "json" constant in it. In other words, there is not full separation of the model from serialization/deserialization methods in the current code.
Quote:
So yes, if anybody feels XML is important, PRs for additional parsers are always welcome!
Btw, I think neither JSON nor XML is nice for manually writing it; For authoring rule templates, we should probably rather come up with some DSL or a nice user interface (which then again is likely to directly produce JSON).
+1
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.23434 seconds