Pathfinder Blog
Topic Archive: XML

GWT and XUL

There are lots of nice things about writing event-based component GUI applications, but constructing UI's using code is not one of them. It's ugly, messy, time-consuming and hard to maintain. It's also a pain to read, which makes the maintenance even harder.

There are a number of solutions that have been tried over the year -- WYSIWYG roundtrip GUI designer in particular -- but the one I like the most is the XML-based UI description. Much like the DOM trees that you can identify with id's and to which you can hook up event handlers, XML UI markup languages -- XUL, SwiXML, Luxor -- allow you to construct a hierarchical UI with absolutely no compiled code whatsoever. Just write the XML, load it, hook up the GUI to the event handlers and you're ready to rock. And since the XML file configuration, not code, you can write and load different XML files if you feel like changing your UI a bit.

If this sounds like a good idea to you, you'll be happy to know that in the GWT Incubator Joel Webber is developing a project known as DeclarativeUi.

Writing imperative Java code to construct a user-interface hierarchy is awkward, and it makes working with UI designers difficult and/or impossible. What we want is to provide designers (and developers) with a simple way to define the static structure of applications and widgets, without having to write code.

Sound familiar? What does this markup and it's user look like?

Continue reading »

Topics: , ,

Grails and JSONP: How Easy is That?

Grails_logo
For all of those Java developers casting longing glances at their buddies doing Rails development, there is hope. Grails, which has just celebrated its 1.0 release, is a Rails-like "convention over configuration" framework that aims to do for the Java world what Rails has done for Ruby. Instead of Ruby, the dynamic programming language of choice is Groovy, which compiles to bytecode (no Groovy to Java translation) and integrates smoothly with just about any Java code you may be using.

I'll stop hyping Groovy and Grails in general here; there's plenty of good informational stuff on the Grails and Groovy home pages. I will note that if you run off the tracks a little bit, you can find yourself reading through 500-odd line stack traces of Groovy, Spring and Hibernate -- there's room for some improvement there.

One of the many nice things about Grails is it's support for JSON and XML. Let me put together a simple example that shows off some of Grails' power.

Continue reading »

101 Ideas for JSONP - Idea #4: Scraping XML with XPath, Part 1

It's been a while since the last installment of JSONP. Lots of good stuff has happened in the meantime to make our lives easier, but some things are still brutish, ugly and complex. One of the nice things in the more recent version of the JDK is the ever improving support for XML processing. Long gone are the days when you had to hunt around for libraries and hope that your version of the JDK worked with your third party libs. There are still reasons, like performance and extended features, that would cause you to pick an alternate library, but if you just want to add a little bit of XML processing into your apps, things couldn't be easier.

Continue reading »

Topics: , ,

Beefing Against OpenLaszlo

Elliotte Rusty Harold is a well know author on Java and XML. His take on OpenLaszlo is that it is a misuse of XML.

OpenLaszlo seems like a confusing mix of JavaScript and XML. I never got clear on just why there was so much XML. It seemed like a classic case of misusing XML because it’s there. I suspect JavaScript alone wasn’t strongly typed enough, and the developers didn’t want to bother writing a parser for a custom format. GWT, by contrast, is pure Java so it’s a lot cleaner. I like XML; I like Java; and if I’ve taken enough drugs, sometimes I even like JavaScript. However mixing them together in the same program just seems like a really bad idea. It’s like constantly switching from English to Chinese and back again in the same sentences.

I've got to agree that the mixing of XML and Java/Javascript seems like a bad idea. As I observed in Cognitive Load and the Superiority of Server-Side Ajax GUI Frameworks:

But why do we get a headache? Back in the 1950's, a professor of Psychology named George Miller observed that the average human being could retain seven items in short term memory, plus or minus two items. When we work with ideas or concept in any sort of analytical thinking, we run up against this limitation again and again.

John Sweller, a professor of Education, came up with the idea of cognitive load in the late 1980's. The basic idea was that your ability to learn and problem solve was limited by your short term memory. If a particular learning task required keeping track of many concept at the same time, it is said to have a high cognitive load and as a result you don't learn as well or as easily. In fact, in analytical tasks like doing complex arithmetic, it can increase the rate at which you make errors. There's a whole body of literature on cognitive load, cognitive stress, etc. Applied to our example of web application development, we see that juggling all of those different concepts in different programming and markup languages and runtime environments in our head, creates a high cognitive load, increases our error rate and impedes our ability to problem solve.

The same criticism could  be made of ZK, with it's ZUML that mixes XML and Java (or other languages). I'm still OK with using XML to wire up components, such as Spring and SwiXML, as these are minimal and have a configuration purpose.

Technorati Tags: , , ,

Topics: , ,

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com