I dislike the idea of trying to shoehorn application logic into the UI description. This will only lead to unreadable code and other problems, some of which Joonas mentioned in the above post. One other problem: how do you debug such code?
IMO it would be best if the XML was for UI structure only, and any logic (listeners etc.) would reside in the java code as usual. OTOH this will lead to new problems, like how to couple the components in the XML to java code.
Personally, I’m not sure if all this is worth the effort and added complexity.
I have just started to have a look at Vaadin and see great potential in the XML UI approach.
As an organisation we have a lot of expertise in XML and this approach looks to me like a short-cut. If I can quickly define a set of screens in XML which I can show to a client in a matter of hours and get buy-in as well as feedback, it would be worth it even if I would have to throw it away and start again when we come to building the real thing.
Now to a more practical question - is there an XSD that will tell me what I can put into the XML file?
Or have I missed something fundamental? I have only started to look at it today…
Not yet. One of the challenges is that XSD depends on set of available components (both in Vaadin as well as add-ons). Maybe XMLUI could somehow generate XSD. Any ideas on a convenient way to get the list of classes implementing com.vaadin.ui.Component interface -?
Actually - for the xmlui itself it could be enough to have a method for generating xsd for any given list of classes. The the party using that xsd probably knows the list better than xmlui. For example - Eclipse could use that xsd for editor code completion and validation and knows the available classes best.
What does “XML” stand for? If it just stands for “Extensible Markup Language.” The name emphasizes the key feature of the language as it will be seen by an HTML user - the ability to define your own tags and attributes, which, of course, HTML does not allow. So XML is just HTML on steroids? So what do
PHP XML , Java XML means?
This approach has a well-understood and very successful poster-child: Apple’s Interface Builder and XIB files, used in every iPhone app. Nothing like billions of dollars in revenue to prove your point.
Definitely use XML, not YAML! There are zillions of tools and libraries for working with XML.
It’s also probably a good idea to declare all of your elements in a custom Vaadin XML namespace.
Don’t bother trying to hack any Java logic into the language. That’s what programming languages are for.
I like everything about Vaadin, except the layout stuff kills me. I suppose this is because I’m coming from the Java programming world rather than the CSS/web design world… but so does everybody else that I work with. In any case, I spend way too much time trying to figure out layout screwups and trying to understand the interaction of Java, CSS, HTML, etc. which conspire to make things worse than e.g. programming in Java/Swing. Trying to get your layout just right programmatically is (for me, at least) painful and tedious.
If you could provide a layout editor that lets me edit the layout visually, save and commit that as an XML file, and then spend the majority of my time working on the programming, I could be much more productive. I know this because I’ve done a good bit of iPhone programming (with Xcode and Interface Builder) and that’s what happens. The Apple “division of labor” between programming and UI design tools works great.
[b]
Any chance we can get “Load” and “Save” buttons added to the
online web demo of Visual Designer that would import/export this XML??
[/b]
If you did that, you will have just made Vaadin 100 times easier to use. I think that would be good for your business
Slightly off topic, but when developing Java Swing apps, I use SWIXML http://www.swixml.org/
What makes it so powerful, is that it just builds swing apps, it doesn’t try to be yet another gui toolkit. What I find myself doing when I use a component I haven’t used before, is I code it using real Java code, and once up and running, I work out how the same can be expressed using XML…
I would love that vaadin has the same type of markup…, just so long as that the XML defines real Vaddin components, and everything that can be done in XML can continue to be done using code. The XML should be an addition to the development process, not a replacement…
On the subject of listeners, further up the thread, Swixml does this by defining an action attribute…
the Xml:
the Java, in the instance variable declarations…
public Action pressAction = new AbstractAction(){
actionPerformed(ActionEvent e){
System.out.println(“Button Pressed”);
}
}
First of all, I find it very efficient to generate source code from XML as separated mechanism, witch allows code injection into projects source or other manipulating… Also, its a good idea to add precompile mechanism to low overhead for XML operating (aka JasperReports).
Finally, i support standartized XML notation with long, intuitively names.