How to make Java suck? Ask Sun!

Whenever I talk about Flex and other Adobe stuff with colleagues and geeks I know, sometimes I get the annoyed answer like “Adobe is evil, it’s proprietary code, there’s a governance issue.” Of course the implicit assumption is that Sun Microsystems does it so much better. Well, let me tell you a story about Sun Microsystems’ tremendous governance.

At this time, I’m trying to put together a prototype for a mobile service of mine, using Java Mobile Edition and several of its optional API’s. One of those API’s is core to my application since it is what I use to connect to my backend server: JSR172, aka Web Services API. When I started this prototype, I knew that using optional API’s is risky, because not all cell phones out there support all of them. But it’s a prototype, I just want to make sure it works on my own super-phone (Nokia N95 8GB), and I’ll try to find a solution later for other phones.

So I ordered my very expensive phone and while I was waiting for it, I started working on my J2ME application. I tested it under Sun’s reference implementation Wireless ToolKit and everything worked just great. Then I downloaded the Nokia toolkit and there I had an issue, something cryptic like “(1) Missing end tag for body or envelope”. I thought it had to be an issue related to the beta version of the toolkit, so when I got my phone, I deployed it there and boom: same error. No way to connect to my backend server! Then I started to get nervous. I left a message on, and nobody seems to be able to give me serious options.

So now I’m stuck with an application that works great on Sun’s reference implementation, but nobody uses their implementation on their phones. It could be that Nokia did a bad job reimplementing the specification. But if Sun had done things right, there would be a comprehensive compatibility test that would enforce all the implementations to work the same. Or at least, there would be the option to replace the phone implementation with theirs. But wait, outside of the WTK, the WSA page has not been updated since June 2005! Come on!

No wonder why Google Android and Nokia Qtopia are working on alternatives…

A first step towards official Flex Maven support

One of the things I will miss the most in the coming Flex release is official Maven2 support. There are a few contributed alternatives out there, like Israfil and ServeBox, but I’ve tried both of them and had blocking issues. Don’t ask me which ones, I haven’t tried in a long time.

That’s why I filed a bug in Adobe’s issue tracking system and I try to encourage people to vote for it (or double-file it now that it has been deferred and you can’t vote anymore).

I know that the jury is still out to determine whether Maven2 is good or not, but as far as I’m concerned, I’ve “crossed the road” and after more than 2 years dealing with Maven idiosynchrasies, I feel comfortable enough to use it on all my personal projects and advocate it on professional projects as well. Now I’m convinced that official and up-to-date support from Adobe on a Maven2 plugin that would offer all the possibilities of the command-line and make it easier to configure the mxmlc compiler is a must to really integrate Flex 3 in serious projects with unit tests, continuous integration, and so on.

Well, I found out today that there is now a Java API for the Flex compiler, something that could make it even easier to develop a Maven Mojo around it. Let’s hope that it’s coming soon.

Penetration in the AIR

In my humble opinion, Adobe has done a great job in encouraging developers to consider AIR as a desktop application development platform. Applications are sexy, you can leverage your HTML/Ajax/CSS skills, and now with Flex Builder 3 and AIR Introspector in the pipeline, we have everything we need… well, ALMOST everything we need.

But of course, having everything that we need to build AIR applications is not enough, because we’re not the only people involved. We have other actors to convince, mainly our bosses and our users. Our bosses because when you’re building a product for a company, adding new technologies like Flex, ActionScript and AIR, has consequences in terms of maintainability, in terms of the number of resources you can find on the job market, in terms of the budget that has to be assigned to training. For that of course, the reference argument is very efficient, and Adobe has done a great job on that too. When you can tell your boss that NASDAQ, eBay, Google and many other big companies they’re admiring are using such technologies, it helps a lot in convincing them.

But I think that there is one target that is still to be addressed: users. Of course, when the application you’re building is targetted at corporate users within the company, once your manager is convinced, it’s almost done. It’s just a matter of adding the AIR runtime to the next company-wide software update. But what if your users are normal people who don’t care about installing a runtime, who are even afraid of installing new stuff when it’s not smileys or search bar addons?  When you build a product for those people, natural penetration rate is vital. And from the last figures we got, “only” half-a-million people have already installed the beta AIR runtime. And something needs to be done to encourage people to install the final version, to improve this penetration rate.

I asked the question to James Ward and Serge Jespers, and their answer was basically “it’s free, we’re talking with Sony and for the rest, if you want it in Windows or MacOSX, mail Bill or Steve and ask them”. And that’s an annoying answer. Because I can’t believe that those companies don’t talk to each other, especially Apple and Adobe. But it looks like when they do, they’re ashamed of it, because they are competitors. It’s like partnerships and synergies are a shame.

Well, let’s hope that all those shiny applications will encourage people to get the runtime and it can be even more interesting to develop new shiny applications, and so goes the virtuous circle.

What do you think? What could be done to spread the AIR runtime?

PS: If you’re like me and you really want to have EVERYTHING to build Flex and AIR applications, you can’t vote for the JIRA issue because it’s been deferred. But James told us that you can file a new issue referencing this one and they will add a vote to it. And who knows? Maybe they will get it done before Flex 4 ;o)

Towards a mainstream Open Source OSGi application server?

That’s official: SpringSource has just acquired Covalent. Or as I explained it to one of my colleagues, “the company behind our IoC framework has bought the one behind our application server”.

My first reaction was satisfaction, because it’s another step forward in the direction of corporate Open Source adoption. It’s always amazed me to see how big companies can be afraid of Open Source. And the fact that there is now one bigger support service offer behind two of the most popular Open Source technologies in the enterprise will certainly reassure some skepticals.

The second “kiss cool effect” was undoubtedly about something I’ve really been playing with lately, since Javapolis: OSGi. The fact that componentization-related JSR’s are so fragmented and so alpha, plus the recent works of Spring Dynamic Modules for OSGi, added to Peter Kriens’ presentation at Javapolis, all of that really got my attention. And now I’m dreaming of building a collaboration platform using Flex for the front-end and OSGi, Spring and Hibernate JPA for the back-end. The only component that’s missing in my big picture is a deployment target platform, i.e. an OSGi application server. Of course, JOnAS is working on that but there’s no documentation on their 5.0 server whatsoever. And I’ve heard Websphere and Weblogic are using OSGi too, but hey, I’m talking about Open Source here! Now have a look at the documentation of both Tomcat and Spring. They’re probably amongst the best Open Source documentations on the planet. Now imagine that quality of documentation for a brand new Tomcat 7 server using OSGi as a core deployment mechanism, and integrating Spring DM libraries to ease the development of web application bundles.


Being creative again

Amongst the things that really amazed me this afternoon in Gent was Lovely Charts, an online charting application that’s currently under semi-private beta. My first impression was something like “if it’s just a Flex alternative to Gliffy, I don’t see the point”. By the way, Gliffy is developed with what was the most advanced RIA technology before Flex 2 came in, namely OpenLaszlo.

Then Jérôme Cordiez proceeded with a small demo which showed something very interesting and reminded of Javapolis 2007. There was a lot of animosity there between JavaFX and Flex advocates, the most prominent JavaFX advocate being certainly James Gosling himself. And it was funny because the only answer Sun seemed to have against Flex was like “everything you can do with Flex, you can do it with Java, and even more”. But of course the problem is not what is possible, but what is easy to achieve. And Flex is far far ahead of Java on that topic. And even though Sun perfectly understood that and probably launched the JavaFX initiative to solve that very issue, I think they’re still too late.

But why is it so important to be able to achieve advanced rich features as easily as possible? Well, that’s precisely what Jérôme demonstrated today: because you lose less time on putting things together, you have much more time to be creative. And as a matter of fact, Lovely Charts is not just a Flex Gliffy counterpart, as it proposes a whole new way to create charts with a very interesting “create and connect” tool. This allows you to basically create your chart very fluently without having to change your tool continuously. That’s the kind of feature you wonder why it was not included sooner in other charting tools, including Visio, Omnigraffle and others.

Hopefully I’ll get my beta login soon so that I can test it further.

Flex 3 to be released February, 12th 2008?

I attended an excellent conference today in Gent university, which was part of Adobe Flex 3 pre-release tour. And even though neither James Ward nor Serge Jespers gave a precise date for the official release, Serge gave us a hint saying that it was the pre-release tour, and that it would end some day. So giving that the last date for the tour is February, 7th in Saint Louis, and assuming that Adobe is perfectly aware of the fact that you don’t release or announce anything on a Friday or Monday, my guess is for Tuesday, February 12th.

Now beside that sort of announcement effect clearly meant to attract some traffic to my blog ;o) I have to congratulate people who organized this event in Gent. And for those who really don’t know what Flex is, or are just too conservative to care, let me just reaffirm that this technology is huge and you should really have a look.

The Fourth Commitment

Following my article about customer satisfaction as a third commitment, I read many articles and thought a little bit about this fixed-price thing. Actually it’s quite funny because the software development industry is about 30 years old at least, and it seems we are just starting to wonder why fixed-price projects don’t work with software the way it works in other industries. And I really think it all started with the Agile Methodology hype because now we’re trying to be pragmatic, we’re trying to embrace the constraints of software development instead of hiding them under the carpet. And one of those constraints is this damn iron triangle.

It’s funny to see how people hold on to it, including both customers and salespersons. It’s like they don’t dare to change it. It’s like they are afraid of changing this model. The problem is that each commitment in this triangle involves a substancial risk that no one is willing to take. But what I realized a few minutes ago after reading this very interesting article is that the reason why it’s really not working is because we’re definitely trying to force a cube into a triangle hole! There’s a commitment we’re constantly forgetting: quality! Whether you like it or not, quality is not something implicit, it’s not even related to the developers on the project. Every experienced developer knows that you can’t code with quality, you have to test it.

My father has been working in a car gearbox factory for over thirty years and I’ve worked there during a month as a summer job when I was a student. And my father is a gearbox tester: a box comes in, it’s set up on the bench, my father goes through first, second, third, fourth, fifth and back down, he listens to the noise that the gearbox is making, and if there’s a problem, it goes back to repair. He does that when the box is finished and the proportion of bad boxes is pretty low, because quality is enforced all through the production line by very careful processes that involve as less intelligence as possible. That’s one or the reasons why robots replace human beings in those factories. Because robots don’t think of their kids or dream of their wife. They just do what they were told to.

Do you really think that this kind of quality can be enforced on a software development project? Of course not! It’s far too intellectual and creative to allow such low-level considerations. And yet I’ve heard tens of times this stupid expression: “software process industrialization”. Come on!

The truth is that the only way to enforce quality on a software project is to test it permanently. To test it automatically, functionnally. To test robustness, scalability, reliability, security, performance. And of course you have to review a lot to ensure that the code remains readable, maintainable and flexible. Software quality can be all of that, and enforcing all those aspects is very time-consuming. It takes some time and some special resources as well. You can’t just forget about that.

So we’re left with four risks: scope, budget, resources… and quality, leading us to four commitments to force into our contracts, right? Wrong! Because there’s something that we’re forgetting: those 4 constraints are changing over time. So here we are, trying to force a irregular and mutating cube into a predetermined and unmodifiable triangle hole. And customers still wonder why it doesn’t work?

AndroMDA, an Open Source MDA toolkit

I gave a quickie at Javapolis today about AndroMDA. It was a first for me, and boy it was hard! My goal with this presentation was to act as a counterbalance to last year’s scripting language hype, to show that yes, you CAN be productive with traditional Java frameworks. It’s just a matter of tools and methodology.

And because I wanted to demonstrate that, I actually challenged myself into developing a full-blown JSF/Spring/Hibernate application in front of the audience in just 15 minutes. And I must admit that I had my eyes bigger than my stomach on this one. I’ve repeated my demo something like ten times, and I only managed to do it once in less than 15 minutes. So that one was risky. And as a matter of fact, I made just a small mistake in my modeling that actually led me to fail showing my running application.

But just for the sake of precision, and in case you need to see it working, I’ve actually attached the final application to this post: TodoList sample application. And here is what you need to do to build it:

  • You have to install Java 5, Maven 2.0.7 (I’ve not tested it with Maven 2.0.8), MySQL 5, JBoss 4.0.5 GA
  • Download mysql-connector-java-bin-5.1.5.jar and copy it to server/default/lib subdirectory of your JBoss installation
  • Set JAVA_HOME, JBOSS_HOME and M2_HOME environment variables accordingly
  • Create a database called ‘todolist’, and allow a user named ‘todolist’ with a password as ‘todolist’ to do everything on this database
  • Run the following commands in the unzipped directory:
mvn -f core/pom.xml andromdapp:schema -Dtasks=create
mvn install -Ddeploy

Please let me know if you have any issue or question related to this sample project. Comments are here for that.

And I’ll probably use this sample application as a starting point for a more complete learning thread so stay tuned.

And by the way, if you need more information about AndroMDA itself, please refer to their official website. The AndroMDA forum is very active as well, and if you can’t wait to get started, you will definitely love the official Getting Started Guide, which exists in Java and .Net versions.

First you’ve got Agile…

…and then you’ve got Management. That’s the main idea I remember from the excellent university presentation I attended this morning at Javapolis: the Zen of Agile Management, by David J. Anderson.

When the guy introduced himself and told us that he was working for Corbis, privately held by Bill Gates, a great deal of worry went through my mind because since the management fiasco with Vista, I don’t really see Microsoft as a reference in terms of agile project management. But then I remembered that Ken Schwaber has worked for Microsoft too. And it took Mr David only a few minutes to remind me that you can’t judge such a big company by only one of its mistakes, even such a big one.

First of all, it’s the first interactive presentation I’ve attended at Javapolis. Sometimes people can get a little disturbed when you ask them to bring their own content into the presentation. But at Axen, that’s something we are really promoting in our trainings, so we find it far worse when we do nothing. Here, there were 4 or 5 exercises that the audience were asked to do collaboratively. We gathered in groups, and discussed given topics and after 5 minutes, he came back to us with a microphone and we talked about what we had come up with. Interesting idea, especially for such a 3-hour presentation with such a big audience.

That was for the “layout”, now for the content.

There were really two parts in this presentation: first you’ve got Agile… and that was the main point of interest for me. First of all, he insisted on the importance of trust with knowledge workers, defining knowledge workers as people who know how to do their job better than their bosses do. And I love that definition. The thing is that sometimes it’s difficult to forget about the traditional role of a project manager, to remember that there are better ways to have visibility and control over the project than micro-management. And it’s even more difficult to limit yourself to just being a facilitator rather than a leader, to get out of the way when the team doesn’t need you and be there only when they do. That’s what a Scrum master is all about. And trust is obviously the basis for it to work.

I also saw a couple of very interesting usages of cumulative flow diagrams, reporting artifacts that I have never used before, but which give some interesting information. The main point there was that the best way to optimize your interventions as a Agile project facilitator is to consider a few metrics, but only the good ones, the best one according to him being the Lead Time, in other words the time it takes for a feature/task/use-case/whatever to go through your workflow from start to end. The thing is that if you implement things faster, you see bugs earlier so there are less of them, so you lose less time fixing bugs and you do things faster, and the virtuous circle goes. And how do you implement things faster? Simple! Do less in parallel. That’s what of the main things that I loved about this presentation: David destroyed many common beliefs, and at that moment, the way he explains this, it seems obvious. And it’s only when you think about it for a minute that you realize how most project managers do things the wrong way.

The second part of the presentation was more about making decisions at a higher level, analyzing metrics, identifying bottlenecks and reacting properly with surgical interventions. Sometimes I was a bit lost with all those numbers but it made it obvious to me that there should be more project managers at conferences like this. One of the exercises was about identifying the bottleneck in the project we’re currently working on, and what we would do about it now that we have some leads. I know exactly where the bottleneck is on my project, but what am I gonna do about it? That’s another question.