|Re: Advise for the use of Sapphire with present schema file [message #1060242 is a reply to message #1060124]
||Thu, 23 May 2013 16:24
| Konstantin Komissarchik
Registered: July 2009
basically consist of some Java interfaces (responsible for the model that implies the mapping to the xml files) and some xml files that do the arrangement of the UI elements (I hope, I got this right).
Yep. You got it right.
To make this process more convenient, I would like to hide some of the xml hierarchy, e.g. skip B and let the user provide directly A -> C. Is this possible?
Sure. The various XML binding annotations support path notation, so you could for instance say @XmlBinding( path = "Name/First" ) and @XmlBinding( path = "Name/Last" ) in your model if an explicit Name element in your model and UI would not be useful.
Is there a way I could automate the creation of the interfaces/annotations from my schema files?
Sapphire does not provide a tool for generating a model from an XML schema, since XML schema is a specification of syntax rather than semantics. Automatically generating a model from an XML schema would result in a bloated model that would not produce a good UI. No automation can look at XML Schema and differentiate elements that are relevant to the semantics of the data from those that serve as syntactic sugar.
The quality of the model directly corresponds to the quality of Sapphire UI. I recommend an iterative approach. Add a property at a time to the model and sdef file after you've understood its semantics from XML Schema, docs, relevant experts, etc.
[Updated on: Thu, 23 May 2013 16:25]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.12560 seconds