JavaPolis - day 2

Java Add comments

The second day of JavaPolis is packed with interesting sessions again. I choose to attend two desktop/ria university sessions. One about Flex, and one about JavaFX. I never played around with both, but I knew Flex is much more mature than JavaFX.

Thinking in Flex, I never got around to test Flex myself. But I saw people working with it. And it always looked great. The speakers were Bruce Eckel and James Ward. James was mostly coding, while Bruce was talking and asking questions, which James answered. It was fun to watch them make a simple Flickr application, and later on a data processing application. Actually they loaded an XML file from a webserver, and put it in a grid component. With little configuration it looked great. After that they started to modify the program to show how to introduce a simple MVC way of structuring the code. When projects get bigger it may be a good idea to use a framework like cairngorm, which implement core J2EE patterns. Another more lightweight alternative is pureMVC.

A fun thing Bruce and James showed was Flash Flow. It's a bit like a game, but you have to figure out the rules yourself. Try it out. This is actually a flash application, not a flex application, but Bruce and James wanted to show the diversity of programs flash is being used for.

Flex has three ways of styling, and you probably will use all three in an application.

  • CSS, you can use cascading style sheets
  • Graphically skinning, for example styling a button with an image
  • Programmatically skinning, by using vectors to draw and gradients to fill for example

A useful Flex component to get XML data (perhaps any data) from a service is the HTTPService object. In Flex you can simply use this element by giving it an url to retrieve the data from. You also have to assign a function to result, to process the data it gets, the function must have an resultEvent as a parameter. And then you set the thing in motion by calling the send method.

James also talked briefly about AIR, formerly named Apollo, which brings Flex applications to the desktop. AIR provides functionality to easily work offline and synchronize when online. There's undoubtedly more to it, but James did not have more time left, or I could have listened better.

The second university session was about JavaFX, JavaFX in Action, by Jim Weaver. It was clear Jim knew everything about JavaFX, but the talk started out very slowly. After one hour the only thing we saw was how to use JavaFX syntax to build a menubar like you normally would do in a Swing application. Around that time I helped my colleague Xander to build a drag and drop example in JavaFX using Netbeans 6.0. I am still trying to get him to blog about it, because we could not find any example on the web on how to do that. The JavaFX support in NetBeans 6.0 is not what we hoped. Actually it is mostly auto-completion, and sometimes even that is buggy. Then again, JavaFX is not very mature yet, so we can't expect the tolling to be that mature, but it would help a lot to make JavaFX more popular. In the meantime the talk got a bit more interesting with many code samples, but at that time I was learning JavaFX faster on Xander's notebook. I do however recommend you read Jim's blog about JavaFX if you're interested in JavaFX. It's packed with examples and tutorials on JavaFX. I myself however think I will let it be for a while and look at Flex.

The day ended with two tools in action sessions. I went to Apache Ivy and Jazz. The presentation about Jazz was a bit fuzzy, and from my point of view chaotic. Maybe it had also to do with the fact it was the last session of the day. The other session was about Apache Ivy. Ivy focuses on managing project dependencies. The strengths of Ivy are:

  • Flexible / Configurable
  • Transitive Dependencies
  • Ensure build reproducibility
  • Robust and well documented
  • Strong conflict management engine
  • Tight integration with Apache Ant
  • Compatible with Maven2 repositories
  • Support large dependencies

What impressed me was the fifth point, Strong conflict management engine. When there are conflicts in a build Ivy will let you know even before you try to compile it. For example project A depends on project B, and both require a different version of a library. Ivy will let you know there is a conflict. In fact you can configure that project A get's the latest compatible build of project B. So if project B recently added the conflicting library, Ivy will get the build before that didn't. You can also configure a library has to be of a range of versions. For example 2.3 or newer. The talk convinced me to try Ivy in my next project.

So far day 2, after having some Greek food and Belgium beers in the heart of Antwerp, it is finally time for bed.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login