Meta-programming a window?

If you want the Vision Window XML to be friendlier, I recommend changing the handler for the window itself to save encoding the InteractionController for last. You may also want to encode the root container first, or nearly first. Almost all of the misery in the existing file format is due to the ‘i’ of the interaction controller coming before the ‘r’ of the root container. (I suspect field serialization is alphabetical.) This one change should cause VisionComponent serialization to approximately follow the display order of the tree.

With this change, the bindings would have object references pointing into the display tree, instead of the display tree having object references into the InteractionController’s bindings.

The next major improvement would come from using window path object references for named components instead of numeric references.

Just these two changes would get you 95% of the way to a reasonably editable XML format.

Another optimization would be an XML shorthand for encoding netbeans-compliant properties without having to spell out all the method names.

{ Edit: I would argue that these are–or ought to be–relatively simple changes to the XML encoder/decoder pair, with very low regression risk. Especially the first one. I’ll bet deferring the InteractionController encoding would yield XML readable without change to the decoder at all.}

3 Likes