Jazoon: Data Driven Applications

25. June, 2008

Not one of my favorite talks, to be frank. Brian Sletten tried to explain how we would write less code in the future because data would become more important. Seeing is believing and I haven’t seen nothing, yet.

He has a few good point like that we should be able to recall data sets which we created with Web 2.0 sites (kind of like bookmarks on steroids that can save the state of the web 2.0 app as you bookmark it). Also, that the semantic web will make a lot of things possible and happen.

I buy that. But on the other hand, we don’t even have a decent UI framework for Java yet and that’s eight (8) years after Swing came out. This sure looks promising; I just wonder if I will be still around when it starts to deliver and companies get the CPU power and network throughput to really run all their data through RDF converters. And see the result before you get downsized.


Jazon: Building DSL’s

25. June, 2008

Neal Ford‘s talk about DSLs and how to create them in static and dynamic languages (Java and Groovy in this case) was very interesting because he clear up the fog around DSL’s a but, why they are great and when they help. Basically a DSL is “jargon”. It is compact code that allows you to express much more tightly what you want than any “general purpose” language (“one site fits all” actually makes everyone look ridiculous).

Remember that old OO promise to allow to mirror the world in a programming language, to allow to model the code after what the customer had in mind? Turns out, that OO was … nah, not lying … it was just overselling itself because customers don’t think in objects or models. They think jargon. And DSL’s allow you to make a compiler understand jargon. That’s even possible with Java even though “Java is like taking to a retard”: You always have to repeat yourself to make sure that the stupid compiler gets what you want (pun intended).

A DSL is not to be confused with an API. An API uses explicit context like “obj.setThis(…); obj.setThat(…);” etc. Here “obj” is the context and “setXyz()” is not meaningful without knowing the object we’re talking about here. A DSL, on the other hand, is all about context and context is implicit. It goes “obj.should(…).allow(…).this(…)”. An example is hamcrest: “assertThat(theBiscuit, is(myBiscuit));” Reads fluently, compact code, and it’s obvious that “is(myBiscuit)” should be compared to “theBiscuit” in some way.

The handouts of his presentation are available from his homepage but without his witty remarks. A pity but still worth to check out if you want to see just how far you can push Java to get code that your customer might understand.


Jazoon: Rich GUI development with Java

25. June, 2008

If you ever tried to develop a nice you with Java, you’ll know the pain. Swing: Old, steep learning curve, unweildy widgets. SWT: Nice, good learning curve, “which JAR’s do I need, Sir?” and who puts that DLL in my search path. There might be other contenders but I don’t even remember their names.

So the guys at Canoo faces the dragon and chipped a few scales off it. As Bruno Schäffer said in his talk:

Developers should focus on the what and not how.

They used Swing, some components from SwingX, JGoodies Smart Client and Jemmy for testing for the UI and something called c3pO for JDBC connection pooling to build a smart client. openArchitectureWare was used to generate a model editor for the data model, so they could generate the DAO classes for that efficiently.

Their application is split into modules but they don’t use OSGi or any other module framework out there because they got in their way, it’s just good old, traditioal loading on demand from the classpath. I can relate to that. OSGi is so great and stuff … but it somehow lost contact to the base. It’s just eithet not flexible enough or not simple enough for me to understand and use.

Good talk but less product placement for your company next time, Bruno.


Jazoon: openID

25. June, 2008

Robert Ott showed off openID. If you wondered about these strange links which start to pop up all over the web near the login buttons, openID is a way to register yourself once at a place you trust and then use that to login elsewhere.

The idea behind openID is that you click on the link, the web site passes you on to an identity Provider which can use any means to make sure you are you and then give that confidence back to the original site. See the openID.net website for details.

The cool thing about openID is that you just have to manage a single identity and use that to log in into various services on the net without giving all of them the same password (and thus make you very vulnerable agains attacks). The main problems which openID doesn’t solve is stalking and spamming.

openID makes stalking easier because you have to enter your openID at every place you want to log in to. Same id means same person. There are talks in the openID community to allow a person to have more than one ID and still use the same identity provider but there is nothing definite, yet.

Also, openID doesn’t protect against spammers. It might help, though, because of two things: a) You can black list identity providers which allow spammers and b) you can send the police to the other identity providers which will hand over the real identity of the person behind the openID to the authorities on court order. So this might help in the war against forum spam, we’ll see.

All in all, a good talk.


Blogging From The Jazoon: Keynotes Tuesday

24. June, 2008

So this is day one of the Jazzon with the keynotes and talks. I’ll go through things as they happened.

Scalable Languages

Martin Odersky, father of Scala, gave an introduction to scalable languages or rather to Scala. Well, Scala looks really promising with its traits and other features. But my original objection still remainds: The syntax is just ugly. Proves my point that there are only five people on this planet who can design a language and of them, I only know Guido van Rossum.

Adoption-Led Market

Simon Phipps followed wth a talk about the “Adoption-Led Market“. It’s astonishing how many OSS projects Sun supports or started and how little is known about that. Marketing again. *sigh* His talk wasn’t all about Sun but how people start to despise vendors or rather their promise that their product is going to deliver to the promise … after you’ve paid for it. Of course in an OSS world, where you can just download something and try it out, it becomes increasingly hard for them to “justify their 1000% profit margin.”

This is a very good point. With OSS software, you pay for what you need (and not what the vendor things is best for himbbbyou). If you need a feature, support or whatnot, well, you can always pay someone to give it to you. But then, you pay when you need it. That makes is a justifiable cost, not an arbitrary one. Also, support gets you what you need when you need it. Just imagine to ask MicroSoft for a specific feature in Windows which you need. How much would that cost? What are you’re chances to actually get it? Forget it! But with OSS, for the first time in software history, you can get what you need for a reasonable price and you might even make someone on the other side of the planet very happy.

Of course, “the greatest threat to freedom is a happy slave” but the talk gave a lot of arguments how to sell OSS to your company, even if that company happens to be the government.

He also gave a good reason which OSS license to chose for your next OSS project:

A license is the constitution of a community

Eben Moglen

Nice guy, good talk. If you can, vote for his photo at his website.

Innovation

The third keynote was by Rod Johnson: “Where will tomorrows innovation in Java Enterprise come from?” After explaining where innovation comes from, he shows how standards kill innovation and how committees can’t drive innocation due to political games by the companies who dispatch the people that form these committees plus general group stupidity.

After the more or less failure of the JCP in recent years, attributed mostly to ignoring feedback from the community and drowning ideas in ceremony, he hopes that JSR 316 (that’s Java Enterprise version 6) will help to fix Java EE. If it does, then that might mean that a good sign that the JCP has become a helper for the Java cause instead of another reason to abandon it.


Jazoon 2008, Day 0

23. June, 2008

Just back from the Jazoon 2008, Tutorial day (the day before the actual conference starts). I attended Ted Neward’s talk “The Busy Java Developer’s Guide to Groovy“. As always, the talk was quite a lot of fun even for someone like me, who already knows a lot about Groovy. If you get a chance to attend a talk given by Ted: Go. It’s worth it.

In his talk, Ted crammed a pretty complete introduction in the key features of Groovy into three hours. For me, the key points of the talk were these: Productivity and ceremony.

Research shows that all developers roughly write the same amount of code lines per day. The difference between guru developers and the greenhorns is that the gurus write a line once and it works first try and each line achieves much more in respect to reaching the goal than any line of a novice. So in order to boost productivity of a guru, the only way is to use a programming language which can achieve more in a single line of code (and we’re talking one statement per line here, obviously). So it’s not that the guru writes ten times as much code per day as the novice, the novice just writes every line ten times because every time, (s)he gets something wrong and has to fix it.

The other aspect is ceremony. A lot of code in Java is ceremony. In most cases, the Java compiler knows where a statement ends and it wouldn’t need the semicolon. Still it insists that I press the key anyway (and it’s two keys on the German or Swiss keyboard). The same goes for many other things in Java which are just there for tradition. It would be simple for the Java compiler to infer the type of an object after if (obj instanceof ...). There really is no need for the cast in the next line. I could find another 10 examples easily.

Groovy does away with all that. It comes at a price, though. If you like to rely on the compiler creating a cozy padded cell for you, checking types and syntax as much as possible, then Groovy is not for you. In Groovy, the idea is that the developer knows exactly what (s)he’s doing and all (s)he needs is the fastest path to get there. You can do all the dirty things you wished for in Java but you don’t have to. Groovy is an “also” language, not an “either-or” language. If you feel that Java is dirty enough, already, try Scala.

Thanks, Ted.

If you want to know more about Groovy and you’re in Zurich, why not attend my talk on Thursday?


“What’s Wrong With Java” as OpenOffice Document

19. August, 2007

Since my presentation at the Jazoon is only available as a PDF (and it looks horrible, too), I’ve uploaded the source OpenOffice presentation to my own website. It includes all the additional comments which are missing in the PDF. You can find it here.

For all those who couldn’t attend my talk: This document summarizes a few weaknesses of Java which are solved in Python and Groovy and why I think that Java is now at it’s peak. From now on, it’s going down. Not overnight, of course, and there is no need to rush into any kind of action. But in ten years from now, Java will be where C is today: Something you don’t want to build your career on (that’s Java, the language, not Java, the VM).


Rating of my Talk

30. July, 2007

The rating of my talk at the Jazoon just came in: 2.74 on a scale from 1 to 5. That’s even below average (3 would be average). Hm. Okay, I was sick and tried to put too much information into my 40 minutes. Anything else I can do better next time?


Back from JaZOOn, Fourth and Last Day

28. June, 2007

In the morning, Neal Gafter gave some insight into “Adding Closures to the Java Programming Language“. You remember anonymous classes? Well, closures are similar but solve all the problems associated with it: You can access and modify variables from the surrounding method, for example. You can use closures to replace all the listeners in Swing. Look at this code:

 InputStream is = createStream();
 try {
    doSomething(is);
 } finally {
    try { is.close(); }
    catch (IOException e) {
       log.warn("Error closing", e);
    }
 }

What do we have here? The actual information is the “doSomething()”. That’s where the interesting stuff happens. Everything else is boiler plate code. Now imagine you must change the logging. You have copied this code a thousand times. The stream has often a different name or it’s a Reader. You can bet that you’ll forget to make the change in at least one place. Okay, it’s just logging, but how often have you seen this pattern repeated? A piece of code where the meat is embedded deeply into some other Java code and the whole thing is duplicated with cut&paste all over the place. That’s what closures are for:

 with (InputStream is : createStream()) {
    doSomething(is);
 }

with() is a method which takes two arguments: An InputStream and a Closure. The code for with() looks somewhat like this:

 void with(InputStream is, {InputStream => void} block) {
     try {
         block.invoke(is);
     } finally {
         try { is.close(); }
         catch (IOException e) { log.warn("Error closing", e); }
     }
 }

As you can see, the code wrapping the closure is now in one place. The same pattern can be used when reading objects from a database (in this case, with() could handle the opening and closing of connections, statements and ResultSet’s). Neal showed examples how to use this in listeners or how to have a loop in the with() method. In this case, “break” in the closure can exit the loop (if you have read enough objects from the database or enough files from the file).

Great stuff. Late but great.

After him, Danny Coward showed how Java will evolve into Java SE 7 and Java EE 7. Not many surprises here. Sun aims for a 18 to 24 month release cycle. That is should give the expert groups enough time to come up with great and stable features. We’ll see about that. I would prefer if they came up with useful features that made developing software easier. For example, annotations in Java 5 could have been a great feature but they can’t modify the code. Makes sense from a compiler point of view but castrates the feature. And don’t get me started with generics. I couldn’t even name a feature of Java 6 that I had seen and that I feel helps me in my daily work.

Enough of that. Where does the big world spin to? Henry Story showed Web 3.0 (and Web 2.7 a.k.a Freebase). The “Semantic Web”. Every information annotated with an URI to tell what it is and how it is related to another information. The whole world seen in 3-tuples. Unfortunately, tools aren’t there, yet. If you don’t want to use VI and cwm, there is not much to chose from. You can try Protégé, Swoop or a commercial product TopBraid Composer. All this looks very promising, especially in relation to JCR/Apache Jackrabbit. Jackrabbit allows to store structured and unstructured data and manage it (search, modify, import, export). This is one step above relational databases which offer only very limited capabilities when it comes to data which is only partly structured or not structured at all (like texts, images and videos). If you’re lucky, you can store this types of data but searching it? Forget it.

The semantic web (SW) looks at the problem from the other side: It allows to annotate data with types, so you can know (or rather, your programs can know) if two “things” are the same, similar or related. Example: You are a person. You have a name. In the SW world, “you” is an object or entity of type “Person”. Your name is a value of type “Person:name”. If you know someone, you can attach the relation “knows” to the entity “you” and then refer to other person objects. Since the code walking this graph knows that it’s traversing persons, it knows that there are names somewhere so it can display them on the screen when you list all the people that you know, etc. For more information, see Henry Story’s BabelFish blog. Maybe start here.

He explained many more details and answered questions in the long Q&A session after his talk. I wished there had been more of these. Many talks raised interests but 5 minutes were never enough to ask any complicated questions.

The talk “JCR, the Content Repository API for Java” wasn’t very interesting for me because it mainly focused on the API. Peeter Piegaze showed different node types and typical Java code. Therefore, I didn’t attend “Content Management with Apache Jackrabbit” but “Development of a 3D Multiplayer Racing Game“. I had hoped for some insight into the problems Evangelos Pournaras had ran while developing the game or details of the physical simulation. Instead, he listed the features and showed the UML diagram of the game. I was very disappointed.

Afterwards, the conference closed with the Jazzon Jam. Over the several days, the moderator had told us about something called “Lighning Talks”. People were supposed to walk on stage, get the mike for two minutes and talk about whatever they want. I was a bit suspicious of the concept but it works. Speakers don’t have time to dally around (setting up the laptop counts against the two minutes!) and get their point over quickly. A nice way to close a conference.

All in all, a positive experience. If possible, I’ll attend the Jazoon’08.


Back from JaZOOn, Third Day

28. June, 2007

There are several ways to rate a conference. Here is mine: How many time do you spend bored in the lobby/outside the conference and/or how often do you wish you were bored outside of the talk you’re currently sitting in?

Looking at it from this angle, Jazoon is doing great. Go, guys, go!

The keynotes today was Eclipse Way to Jazz by Erich Gamma. It took me some time to figure out what Jazz actually is. There was no abstract and Erich rushed us through the talk. Apparently, it’s a tool to design a software process in the Eclipse way: Help you to get your things done without getting in the way (at least as long as you can keep the pointy haired boss (PHB) away from it). This looks pretty promising, even for a process-hater like me (seen too many processes imposed by PHB’s who think anything can be solved by micro-management) since it allows you to keep track of all the info (for example all bugs, the state of the current build(s), messages from team colleagues, your todo-list) in the IDE so you don’t have to go back and forth between tools to keep track of all this non-coding work.

It’s planned to be a commercial tool which is understandable but still a pity. OTOH, how many OSS projects need to keep a schedule? Some part might be available for free but not Open Source. We’ll see. I was impressed with the UI which looks pretty slick for a Java app, even when using SWT and forms.

Next in my schedule was of course “Why can Groovy succeed?” held by Mike Müller. Many nice arguments but I was missing the main point: Groovy (or any other language or Java library or whatever) will succeed as soon as one of the main players (IBM, Sun, etc.) adopts it. Large customers (= those who pay bills which get converted into developer paychecks in turn) will not adopt anything that isn’t backed by big companies. I’ve heard that “Oracle backs Groovy and Grails” which is promising but, despite Larry being one of the richest men in the world, well, Oracle is not IBM. I don’t want to be the bad guy here but … well … let me put it this way: If you plan to buy a new telephone, are you going to ask your plumber which brand you should get?

Sun’s support is half-hearted at best (“We don’t care which language it is as long as it runs on the Java VM”). Let’s see if IBM can afford to spare some attention. If you want to learn more about Oracle’s stance, here is a press release. Good luck to them.

Next, JavaFX. I’m someone with broad interests and I know a bit about design, too, and layout. For example, I know what a “river” is (when whitespace in adjacent lines creates verticals gaps in texts that irritate the eye) and I’m using TeX to layout my texts (which not only formats it nicely but also gives me feedback how “bad” a paragraph looks). When I first heard about JavaFX, it was just another UI description language. Oh bother. Instead of creating a good UI builder like Adobe’s Flex 2, they created another programming language. And no, Matisse doesn’t cut it. Matisse does Swing and a swing is something kids have in the backyard. It’s a toy. In 2007, Swing UI elements still can’t be connected to bean properties without the help of some extra library. In 3.3, Eclipse at least comes with the binding framework.

Back to JavaFX. Designers will never ever touch a text editor even if their lives depend on it! They use Photoshop or Illustrator or Flex. Tools that can do all kinds of amazing things with just using your mouse or *gasp* a pen tablet. Any software developers here? Who has a pen tablet attached to his computer? Ever used one? Forget about text editors. That’s just like asking your boss: “Why don’t you come to work with a VW Golf instead of your Lamborghini? I would feel much better!”

“Who cares what you feel? Get to work! The rates for my fourth Porsche aren’t payed, yet!”

Ahem. Where was I? Oh yes, JavaFX. At the Jazoon, they showed quite a few very nice demos what you can actually achieve. There was the usual boring stuff (showing that you can type in some code and the result of that code is shown in near-realtime) but they also converted the Tesla Motors website into a JavaFX app which looked and behaved so similar that you could only tell the difference by looking at the header of the window (one had the browser toolbar in it). Nice and smooth transitions. JavaFX connects Swing, Java 2D and it supports data binding, something that should have been in Swing 1.0 (when it was still called JFC).

Unfortunately, they didn’t show how the code (i.e. how many horrible hacks they had to use to make it work) but apparently, you can download the demo and see for yourself. So it looked pretty slick and nice and appealing. I’m just not really convinced that the designers will swallow the JavaFX pill. Sun is concerned that there is no compiler for JavaFX, yet, but designers don’t care about compilers. They care if they can do anything from their pen tablets. A designer will only touch her keyboard when she has to add the few lines of text to her work.

On the positive side, Anatoli and Greg gave a great show. Thanks, guys! For all the companies out there who think about sending someone to present them at a conference: Send two guys who get a long with each other very well. That way, one of them can do the presentation and the other can use her/his head to keep things interesting. Also, that way, more of your staff gets free conference passes. Win-win.

A short break during which I rode the elevator with Bruce Willis. Well, not actually Bruce Willis but his character John McLane. And not the character as such but an image of him. Many in fact. Thousands. 24 * 60 * 60 … bc to the rescue … 86’400 … but he’s not on all of them … say 50% … that makes roughly 43’200 images of John McLane, give or take 5’000. If you still don’t know what I’m talking about: I was riding in the elevator when the cinema staff brought the second reel of the movie Live Free or Die Hard (called “Die Hard 4.0” in Europe) was brought in. I had a camera with me but I was too upset to think of taking a picture. You’ll have to believe me. I really was in that elevator …

The last show in the morning was Revisiting the Anything Pattern. An “Anything” is a data structure which has properties of a list (it keeps the order in which elements are inserted) and a hash (you can attach names to items of the list and access them by name). Nice and powerful, especially for configuration-like data. The guys around Stefan Tramm extended the original code so you can now read JDBC ResultSet’s into an Anything and write them back into the same or another database. Nice stuff. There is a google project at http://code.google.com/p/java-anything/. You can find the source at http://java-anything.googlecode.com/svn/trunk/. Don’t be confused that there are two directories there: “initial-release” is the original code as Stefan got it and “starting-release” contains the extensions of him and his team (including the DAO code). Use that one.

In the afternoon, we all enjoyed Die Hard 4. Nice movie, lot’s of action and good characters. Go watch it.