Moving to Blogger


My blog has been moved to http://www.javacraft.org/, on Blogger. I was waiting for the domain to become active to announce it.

This is the last post for my blog on WordPress.com. See you at Blogger’s. 🙂

Published in: on April 17, 2012 at 19:47  Leave a Comment  

Poch Apache Attitude Rant !


I’ve been banging my head on a few configuration problems lately setting up a proper development environment. During which I encountered and worked around some annoying bugs. Some of which in Maven.

I thought that in the brotherhood of open software development, it was regarded desirable to contribute. That’s how it stays alive. I also thought that reporting bugs was regarded as a valid way of contribution. I’m regularly doing this because I am way too busy to delve into the code of each tool I’m using. Certainly if there’s a workaround. But always do I report the problem in some way. To make at least the owner aware of the problem. And indirectly the users too as Google is indexing everything anyway.
I thought – naively it seems – it would be appreciated. Not so at Apache. Things seems to be different there. And unfortunately it’s not the first time I’m getting the this kind of replies from them.
https://jira.codehaus.org/browse/SUREFIRE-833 => Where’s the implementation for the change you propose ?

https://jira.codehaus.org/browse/SUREFIRE-832 => Log a different ticket for that last sentence. I’m too lazy to do it myself.

Hey guys – this is the open source community at work ! Not some brainless commercial corporate operation. If you like rules that much, go work for them. Or become one of their managers if you have such a disdain for what people do for your project.
Published in: on February 10, 2012 at 10:44  Leave a Comment  

JRebel Rocks !


I’m giving JRebel a spin. Man… this thing copes with any change you can image ! Before JRebel, I could occasionally hot-swap code in debug mode. But more often than not I had to stop, redeploy and restart. Now I’m restarting Tomcat no more. At all.

What’s original also is that this is the first software I see encouraging its user. 🙂

Published in: on November 25, 2011 at 12:45  Leave a Comment  

Devoxx 2011


This year I went to Devoxx with the firm intention to learn about the programming model of Android and JavaFX. And above all check what the HTML5 hype is all about. Especially since it becomes clear Java developers can’t just hide anymore from JavaScript and CSS. Denying your involvement into JS & CSS today would amount to telling you’re not interested in the ways your Java services are used. And you’ll simply be unable to solve bugs which flow brings you into the front-end code. Which today is heavily relying on JS. You can’t just refuse to use it because you don’t like it.

Besides this, I’m checking for the feasibility for these technologies for my employer’s products.

Personally, I don’t like JS. It’s just too chaotic – in my opinion – for reliably building complex application. And the fact it runs in the front-end means anybody can interfere in its execution. Hence messing with the data sent to the server. Which you therefore need to check again in the back-end code. Not to mention JS code is dynamic by its very own nature: Functions can be added anytime to objects. And its execution browser-dependent. Sometimes even the OS and hardware interfere there too. So really… 🙂 But there’s no denying it: it’s  here to stay.

I avoided the talks about the current JDK & Oracle controversy. No need to see Mark Reinhold’s slides a third time about Jigsaw. Or hearing Brian Goetz telling how incredible SAM’s are. They all already said this at JavaOne 2011. For me personally, the dust still has to settle about the way things goes with Oracle now. Not the least because the Oracle speaker’s opinions are often very Oracle-minded. While in Sun’s days nobody was afraid to speak his/her own mind of their employer.

Anyway, I was not disappointed by Devoxx for my expectations. Also note that I’m expressing my personal opinions only.

Android

http://www.devoxx.com/display/DV11/Android+Jumpstart+-+Introduction+to+Android+App+development
  • Current release is 4.0.
  • The API is a subset of the JDK’s API. With it’s own component model added – just like it is for Swing.
  • The source code doesn’t compile to regular byte code. It compiles to executables for the Dalvik VM. Which is register-based instead of stack-based for the regular JVM. Allowing it to gain better performance. Although the application needs to be tuned towards the limited amount of resources the mobile device has.
  • All major IDE provide support for developing Android application.
  • There are emulators for local development.
  • … much other cool stuff !!!
My notes can be downloaded here. Excuse the handwriting, I’m trying to write with a stylus to eliminate all paper notes. 🙂
Unfortunately I have to discard Android for coding at work. There is no reason to write an Android-only app. And even if it was, Android is nowhere near to the heavy graphic- and data volumes we need.

JavaFX

http://www.devoxx.com/display/DV11/JavaFX+2.0+-+A+Java+Developer%27s+Guide

Just like Android, JavaFX is one of the main subjects of Devoxx this year. Being familiar with the previous releases I was wondering what they had done to make it more potable for Java. As this was the main objective of JavaFX 2.0: Port it from JavaFX script to Java. And maybe they have solved a number of deployment restrictions in the process. They didn’t…

  • Current release is 2.0.
  • It’s really a port of the JavaFX 1.x script API to Java. Luckily they kept the scene-graph model. Which allows really cool graphic stuff.
  • The OS-dependent video-codec availability is still there.
  • It’s hardware accelerated. On ATI, NVidia and Intel hardware that is.
  • What’s new:
    • WebView: Webkit HTML rendering. But what’s the point ? A browser does the same and doesn’t require additional software to be installed.
    • ScalaFX & GroovyFX: The same API but written for Scala and Groovy. Which is much more concise than the Java API.

The JavaFX guru’s would probably refute, but for me personally I think it’s too little too late. By removing the JavaFX script language, this is now just the new Swing. (Although a very improved one !) No doubt this is a quantum leap forward for the looks of Java desktop applications. But …

  • It won’t make Java desktop development any more popular. Seeing the capabilities of HTML5 and the landslide development pace it took. I think Java as of now really is a back-end language.
  • Not to mention the restrictions for distribution and deployment of JavaFX applications. Which don’t apply at all for regular web applications.
  • What about mobile devices ? Sun’s original plan was to port it to mobile and TV.

It’s a pity. Because I was very fond of the original JavaFX. But the current one has nothing to differentiate itself from the rest. It has impressive graphical capabilities. But who’s going to need them ? And to what extend are they different from HTML5’s WebGL ? It’s also hardware accelerated. I personally don’t get all the media attention Oracle puts into JavaFX. But I hope I’m wrong about it’s future. Still got a soft spot for it. 😉

My notes can be downloaded here.

HTML5

http://www.devoxx.com/display/DV11/Intro+to+HTML5+Game+Development
http://www.devoxx.com/display/DV11/Bleeding+Edge+HTML5
http://www.devoxx.com/display/DV11/From+Java+Swing+to+HTML5+Canvas
http://www.devoxx.com/display/DV11/HTML5+with+Play+Scala%2C+CoffeeScript+and+Jade

No doubt HTML5 was thé star of Devoxx 2011. Many talks were scheduled for the various aspects it covers. I was particularly attentive to them because it’s very probable I’ll be confronted with it very soon for my job.

It appears HTML5 is even moving faster than I originally thought. It’s not a hype; it’s a landslide ! Catching-up speed with every new browser release of the ongoing second browser war. I might be wrong, but from what I saw Google is the lead. What became also clear to me also is that JS libraries are now available in high numbers. Just like they are for Java. I interpret this as another sign that JS, CSS and HTML5 are taking over the desktop and browser. It’s just too popular to simply go away. Last week I knew JS was becoming ever more popular. But I had no idea it was to this extend.
Soon webGL is expected to become mainstream. Which should open the door for JS application to modern graphic capabilities. A domain that was reserved to desktop applications only.
HTML5 features among others:
  • Easy 2D graphics.
  • Multi-media support (without the codec restructions of JavaFX)
  • Support for offline mode & local storage.
  • Event listeners for various system & browser events (ex. whether the page is hidden).
  • Integration with world-wide service providers according to their type (ex. sending email, processing pictures, …)
  • Run code in background.
  • Database + transactions support.
  • Tabs.
  • … much other cool stuff.

Again, I’m not happy with JS becoming so incredibly present in web development. But denying it would be plain stupid. If that’s the way it goes, that’s the way it is. Accomplished Java web developers have to know about JS/CSS/HTML5 very soon now.

My notes can be downloaded here. A book recommendation I had: Introducing HTML5, second edition.

Spring

http://www.devoxx.com/display/DV11/Spring+Data+JPA+-+Repositories+done+right

I’ve heard about this one before and this was the occasion to learn about it. The basic idea is to write Spring Repositories (aka DAO) using only Java interfaces. No concrete class is being written !

The interfaces declare methods whose signature tells everything about the intention of it. JPA Repositories works according to a convention. If you adhere to that convention, it will generate your DAO implementations for you. In case you have complicated queries- and frequently reoccurring constraints, you can implement those as predicates. And reuse them in the methods.
Also support for auditing (who’s done what and when) and paging (query records batch by batch).
How cool is that !? 🙂

My notes can be downloaded here.

JVM / JDK
http://www.devoxx.com/display/DV11/Are+your+GC+logs+speaking+to+you
http://www.devoxx.com/display/DV11/What%27s+In+Your+Toolbox+for+JDK+7
http://www.devoxx.com/display/DV11/The+File+System+API+in+JDK+7

These were the sessions I attended. Apart from the last, they were disappointing. The first was an overview of generational garbage collection. And even that is not possible in a one hour time-span. The second appeared to be a – abbreviated – overview of Project Coin. Which no doubt everybody can find tenths of more complete sources in seconds. The last one, however, was worth it.

The file system API is located in java.nio.file. And basically the class Path replaces the good ‘ol File. Many operations you need Commons IO for are now native. File and stream copy- and move, to name a few.

What’s really new is the fact that finally the file attributes are also available. Permissions, owner, … And they’re updatable ! For performance reasons these can also be collected in bulk. And indeed, I often noticed File.isDir() on top of stack traces when profiling applications. I hope this is finished now.

What’s really cool is the notification of changes for directories and files. No need to poll any more.

And my favorite: Zip and jar files can now be used as file systems ! 🙂

An interesting blog entry about what’s store for the JDK.

I’ve got notes herehere and here. My hand writing is getting better, isn’t it ? 😛

Java Enterprise Edition
http://www.devoxx.com/display/DV11/GlassFish++++Application+versioning+and+high-availability+rolling+upgrade
http://www.devoxx.com/display/DV11/What%27s+Coming+in+Java+Message+Service+2.0
http://www.devoxx.com/display/DV11/Real-world+deep-dive+into+Infinispan+-+the+open+source+data+grid+platform

The Glassfish presentation was short, but informative, introduction into the versioning of applications. Basically it comes down to give a version number at deployment time. The previous version is disabled and makes places for the new version. Should the new version be broken is some way, you can revert back to the old one. There are various options to switch back and forth without losing a single session or request.

Doing this for a cluster is still manual though. Cluster-wide deployment would really be helpful though. 🙂

Currently just one version can be active at one time. There are plans though to have more than one. For instance to have the regular users run the old version and the final testers the new version. After which the old version is disabled and all traffic rerouted to the new version. But the active versions won’t be isolated from each other. They really act as concurrent applications to the same backend.

The JMS presentation was one of my biggest expectations. Finally one of the flagship JEE modules gets a workover. I have no doubt a lot of progress was made, but the presentation turned out to be a big disappointment. Lots and lots of explanations about what’s wrong with JMS 1.1, the challenges to define a new api, etc… I think the lesson is that the API will be much simpler (which was about time) when sending messages. And will rely on CDI for injecting the various related objects. It will be released with JEE 7, Q3 of 2012. I’ll check on it then – IF I need JMS that is !

That’s what you get for letting managers present technical subjects. Even if they are the spec leads. Pity…

It tuned out that the Infinispan presentation was one of the best I saw this year. I’ve heard about Infinispan before, but never had the occasion to check on it. Until now.

Infinispan is both a caching- and datagrid solution. Depends on what you use it for. You can use it as a 2nd-level cache for Hibernate. For which is seems to be able to do everything besides cooking your meal. 🙂 It can be embedded or distributed. In both cases it can be transactional. Monitored by JMX if needed. Provides cache statistics. Overflow to a persistent store. Event listeners supported. Preloading of caches. Encryption. Authentication. Etc…

In case of distributed caching, it relies on JGroups for communication. So basically, if there’s a wire between the machines, it will work.

What’s neat is that the cache synchronization in a distributed case can happen according to various strategies:

  • Replication: Any change is propagated to the other nodes. Exponentially expensive with the number of nodes.
  • Distributed: The propagation is done according to a hash function which designates to which nodes to propagate. Less expensive than replication.
  • Invalidation: The cache entries are not propagated. Only their keys. Which are used by the other nodes to remove that particular entry from their own caches. The least expensive.
In case of a datagrid solution you add- and query data to/from the cache. And if the need comes to it the contents of the caches is persisted into cache stores. Which can be files, cloud, a JDBC database, Berkeley DB (OODB) and any store of your choice if you implement the SPI.

definitely give Infinispan a try. Usually I work with EHCache; which is simple and quick. But doesn’t support transactions.

I’ve got notes herehere and here.

JVM Languages
http://www.devoxx.com/display/DV11/Scala+Enthusiasts+Gathering
http://www.devoxx.com/display/DV11/Cracking+Clojure
http://www.devoxx.com/display/DV11/The+Kotlin+Programming+Language
http://www.devoxx.com/display/DV11/HTML5+with+Play+Scala%2C+CoffeeScript+and+Jade

Being a Scala enthusiast myself, I couldn’t miss the meeting of Europe’s Scala amateurs. It seems we all have the same problem: We would like to introduce it at work, but we can’t convince anybody to start with it. 🙂 England’s the best country for Scala jobs though.

Matt Raible gave a very entertaining talk about his quest for convincing the organisation of Devoxx to bring him to Belgium. To drink beer that is. So the theme of his presentation is applying Scala technology as a means to that end. Next to JavaPosse, he’s the most entertaining and captive speaker I’ve ever seen. 🙂

More precisely stacking a whole lot of successive products: Play, Coffeescript, PhoneGap, Jade, HTML5, JS2Coffee, Less and Anorm. Just to name a few. Because he’s not only entertaining; he’s also bloody fast ! Usually there was a fast-paced introduction to a product which ended with “… and I blogged about it”.

It’s so fast, that I’m still trying to cope with the implications with what I saw:

  • There is no need to develop in JS. Coffeescript has a more robust- and concise notation.
  • JS2Coffee is an online tool to convert JS into Coffeescript. Seems to work okay.
  • Play is an innovative Scala web framework which allows quick development cycles. Everything you need to know is shown in the browser. If it works, you get the expected result. Otherwise you’ll get an explanation of to why it didn’t.
  • No need to spell out HTML when using the Jade template engine.
  • Anorm is the “Hibernate” of Scala.
  • Learning Lift can wait.
At the end Matt shows a video he shot during the development process. Grinning his head off. No doubt because he can finally hear the soundtrack on full theater strength. I really advise to check his video on Youtube. His slides are on Slideshare. Other speakers left their slides there too btw.

Earlier this year Jetbrains announced the imminent release of their own JVM language named Kotlin. And now, there it is ! I attended because of the reputation of Jetbrains to make software that matters. Their language has many things good. But really, it’s too late. However good it is, are we going to learn just another language ? If they had released two years earlier, I think I might have ditched Scala for it. It’s concise and has implicit robust design support. Maybe it will get more coverage later. But I’ll be very surprised they ever reach Scala’s current support level.

Sorry Jetbrains… I am not going to learn a second just-for-fun language.

Cracking Clojure is one I attended out of curiosity. I’ve read two or three things about it. Knowing it’s LISP’s spiritual offspring only made me more curious about it.

I held firm courageously for the first 15 minutes. When the examples became longer and longer I drowned in the flood of parentheses. I have no doubt Clojure has a niche application market. But I’m still searching for it. It’s certainly not business. It might be maths or technology. But even there, I’m not quite sure. What’s intriguing is the fact it considers code as data. And inverse. Functions are lists of statements. And statements are lists of arguments with a name. Etc… A Clojure application seems to be a tree-structure which nodes are sequences of … things. Although I won’t stake my reputation on it. 😛

Clojure is a curious beast which usefulness still eludes me. And especially because it does, I’m decided to find it out ! 🙂

I’ve got notes herehere and here. The slides on Slideshare.

Jackpot
http://www.devoxx.com/display/DV11/Jackpot+3.0+-+Large+scale+custom+refactorings+made+easy

This one was attended because the title appealed to me. Not for the first time did I which for a tool a can do application-wide source code refactoring. Without doing it manually file by file.

Jackpot is an old Sun project revived in Netbeans 7.1 in the form of source code hints. The IDE will advise of a certain (potential) problem. That’s one. And the cure(s) to solve it. That’s two. What modern IDE do today.

The difference is that Jackpot is custom-configurable. It has an extensive search & replace DSL to select parts of Java source code satisfying certain criteria (the problem). And when found, the possible code it can be replaced with (the cure). And what’s really making this a live-saver is that the IDE can be instructed to apply this in bulk; using the new Inspect and Transform functionality of Netbeans 7.1.

Yeap. Netbeans got even better !

I’ve got notes here.

UI Design
http://www.devoxx.com/display/DV11/Rules+for+Good+UI+Design

Joe Nuxoll presented his UI design wisdom in a more than crammed full room. Being involved in visual prototyping myself and a BIG fan of the JavaPosse, I just could miss the occasion.

It appears design is nothing rational. It’s all about taste; and therefore directly about the mood of the people who decide what’s looking good. Often communicating with them is the key.

The remainder of the talk was about “golden eggs” – concrete advise of do’s and dont’s. Even if instinctively you know them make sense, it’s good to see them confirmed. I’ve written them down into the notes.

I’ve got notes here. The writing’s terrible – I forgot my stylus in the car. 🙂

Two book recommendations:

JSR-107 Java Caching
http://www.devoxx.com/pages/viewpage.action?pageId=5015407

A talk presented by one of Terracotta‘s guy’s. Judging by his accent I would guess he traveled quite a distance to be here. From down below ? 🙂

JSR-107 is not the first attempt to standardize caching. But it’s probably the first one which will actually deliver. There’s a specification that’s currently up to its 0.4 version. The key concepts are almost identical to those of EHCache – one of Terracotta’s products:

CacheManager -> Cache -> Entries -> Keys & Values.

Unfortunately this talk was a bit too EHCache-minded in my opinion. Anyway, I’ve heard nothing new.

Except for one gem: The annotations allow – finally – for memoizable methods. Meaning by simply annotating a method in some way you can tell the method should be executed just once. The next times the returned result will come out of the cache. I’m usually pulling this off with a custom annotation, AOP and EHCache.

I’ve got notes here.

My Devoxx 2011 action list
  • Read the HTML5 recommended book.
  • Give Play a spin. It is quite different from servlet’s & co and it just might be the leverage to introduce Scala at work.
  • Port code at work to Infinispan.
  • Give Spring JPA repositories a try at work. If this works, it will greatly help adoption of JPA.
  • Read the design recommended book.
  • Try to find a concrete, unforced and naturally fitting use case of Clojure.
Conclusion
  • As ever Devoxx was great. And was finished way too fast ! 🙂
  • The wristband is an understandable attempt to easily identify the participants. But really… it’s sticky and irritating. I’m still feeling it. I wouldn’t be surprised if some people complain about rashes. 🙂
  • The WIFI was less good than last year, but still well enough to make Devoxx more enjoyable even.
  • Let’s not talk about the coffee, shall we ? But the HTML5 coffee mug is great ! 🙂
  • I’ll be there next year !!!!

PS. Does anybody in here knows a nice, old-looking, WordPress theme ? I’ve tried loads…

Published in: on November 19, 2011 at 11:27  Comments (5)  

Silly me … :-)


An application with compilation errors can run in Netbeans. As long as the faulty classes are not used I presume.

In that effect Netbeans asks you to run anyway.

Don't check the checkbox !!!

Maybe this dialog gets annoying when this happens frequently. You might get tempted to check “Always run without asking”. Be very careful with that because there’s nowhere else to uncheck it. I might be wrong, but I have the impression this sometimes also messes up other classes too. I frequently had to clean the Maven project before running a test all over again.

If by any change you happen to have checked the checkbox of the dialog, you’ll have to delete a file first. And for good measure quit Netbeans before that. If you remove the file

.netbeans/7.0/config/Preferences/org/netbeans/modules/java/source/BuildArtifactMapperImpl.properties

Why didn’t I thought about that earlier ? SILLY ME ! 🙂

 

 

Published in: on September 27, 2011 at 16:02  Comments (1)  

Intellij idea 10 on JDK7


Looks like Intellij on JDK7 is faster ? My Maven build surely does !.

http://teamsys.intellij.net/issue/IDEA-56674?query=%23issues

Published in: on March 24, 2011 at 12:13  Leave a Comment