• Home
  • About
  • JavaOne 2011 Monday

    October 4th, 2011

    The technical keynote started with a weird JavaZone-style video featuring a Java programmer as a rapper. It was certainly intended to be funny but as far as I can tell, it didn’t catch on.

    The keynote was packed but the somehow reduced ballroom layout added to this impression. Attendance was said to be twice that of last year (so probably around 10’000). Even though there are certainly more people than last year, a doubled number seems a bit exaggerated to me. Throughout the day, all talks were well attended, though, but nothing like in the days when JavaOne had 10’000 attendees in Moscone Center.

    The technical content was not surprising, beside that Oracle now advertises its NoSQL solution, which is based on the former Berkeley DB. As expected JavaFX 2.0 GA has been announced along with the respective tooling and covered by 50 (!) talks on JavaFX at JavaOne. The JavaFX presentation started very conventionally but in the end showed some really cool lab projects with a dancing duke steered by gesture recognition.

    The best presenter was Mark Reinhold on Java 7/8/9. Good style, nice slides, perfect pace, interesting (but not really surprising) content. New to me was project Nashorn: new JavaScript implementation for the JVM expected for Java 8. Project Lambda is planned to contain “defender methods”, default implementations for interface methods. That sounds like traits and actually I expect some issues when doing this in Java.

    Overall, the keynote was missing the JavaOne “feeling” from the olden Sun times. There was no host that led through the event, welcomed the attendees, and encouraged everybody to network. No big names on stage, no overwhelming achievements. The crowd left the room unexcited.

    For the rest of the day I was mainly concerned with preparing and delivering my own talks on “Extending Java’s reach with Groovy” and “Pro Groovy”. They were well attended and received.

    Andres delivered his Griffon talk in parallel.

    Afterwards, I was a tired but still listened to Charles Nutter on JVM bytecode, Dan Sline on Griffon, and Jim Discroll on Groovy DSLs. Quote to take away: “Oracle ADFm makes heavy use of Groovy!”

    That’s it for today.


    JavaOne 2011 Arrival

    October 2nd, 2011

    This is gonna be a short series about my impressions of JavaOne 2011.

    As always, it is nice to see the town decorated for the event, even though Oracle World gets certainly much higher attention. So the immigration officer as well as the nice guy sitting next to me on a bench at Union Square ask “ah – you are a programmer? Are you here for Oracle World?” “Hmpf…”

    Should you ask yourself “what’s in for me”? Here is a first answer: the conference material

    The bag is not very practical for a software developer. I guess the selection has been taken by an Oracle employee who assumes that their conference attendees never carry any material themselves in the first place (which may be true for OracleWorld). The jacket is very nice, though.

    And, yes, you can rate conference organizers by the badges they produce. Hey, that should not be too difficult, right? Here is what you still can make wrong:

    • Printing the delegate’s name so small that it is hardly readable from more than 20 cm away. Now since the badge usually hangs at belly height (if not lower) this can be a bit embarrassing for both involved parties.
    • Second, the name belongs on both sides of the badge! Really! How often did you try to read the name only finding that the badge hangs the wrong way around?

    Otherwise, the waiting time was not too long. The speakers registration was actually empty when I arrived. The attendees registration was pretty well filled, though. But then everybody has to go to the material pickup which was for me in Moscone West 3rd floor where I waited in line for about 20 minutes and I was very early and the queue grew much longer afterwards.

    This made me think about my latest work on highly concurrent producer-consumer scenarios (http://people.canoo.com/mittie/kanbanflow.html) and what it would need to improve the situation.

    Otherwise, from studying the program schedule, I found that Oracle has wisely chosen to pretty much always put two Groovy-related talks in parallel as if to make sure that nobody can escape the Groovy (\G) in these time-slots.

    I’m eager to see what the week will bring.

    Dierk Koenig, @mittie


    Mock Objects with Spock Screencast

    July 13th, 2011

    This screencast demonstrates how to use Spock testing specifications and Groovy for mocking and stubbing behavior in unit tests. It covers creating the mock object syntax, setting expectations, verifying and spying on results, and argument matchers.

    If you have any issues with video playback, then trying viewing it from the JBrains.tv website

    Here are some useful links to read for this webcast:

    I’ve made a lot of screencasts and blog posts over the years. If you like this, then there are many ways to see the other stuff I’ve done:

    Phew, that’s a lot of self-promotion :)

    The screencast was created with Ubuntu 10.04, PiTiVi, Audicity, gtk-RecordMyDesktop, IntelliJ IDEA, and LibreOffice. OS from top to bottom.

    Thanks for watching, and leave a comment!


    Grails Podcast Interview with Hamlet D’Arcy

    July 11th, 2011

    Last week I sat down with the gang at the Grails Podcast and talked shop for about 45 minutes. We talked about a lot of different topics such as Groovy, Lean software, Spock, Groovy in Action, and of course Hackergarten. Check out the full audio and shownotes over at Grails Podcast Episode 125.


    IntelliJ IDEA 10.5 for the Groovy and Grails Developer

    May 23rd, 2011

    The formal release of IntelliJ IDEA 10.5 came out this month, and the new Groovy features are all part of the free and open source Community Edition, and the Grails features are part of the Ultimate Edition. IDEA X (or 10 to you non-Romans) was a larger release of the product, and I already blogged about IDEA X for Groovy and IDEA X for Grails. There’s still plenty of nice features in 10.5 though. The prices for IDEA recently dropped between $100 and $50, and anyone purchasing IDEA since last November gets 10.5 as a free upgrade.

    Here’s what 10.5 is all about (or skip straight to the release notes).

    Groovy 1.8 Support
    A big push in IDEA 10.5 was Groovy 1.8 support. Groovy 1.8 contains many compile time AST transformations that do things like write out new methods and fields into the Groovy .class files. Normal IDEs will show in-IDE compile errors when using these annotations yet still allow you to compile and execute the script. This has been fixed in IDEA, so the IDE should give you proper code completion and support when you use @Field, @TupleConstructor, and @Log. This is especially helpful when invoking these synthetic members from Java code.

    Introduce Parameter and Introduce Field Refactorings
    Introduce Parameter is one of my favorite refactorings. Select a local variable within a method, press Ctrl+Alt+P, and the local variable is extracted into a method parameter. It doesn’t yet work for closures, but you can vote for that feature. Introduce Field is also handy: select a local variable in either a method or a closure, press Ctrl+Alt+F, and the local variable is extracted into a field on the enclosing class. IDEA is not capable of extracting a field in a script yet, which would logically create an @Field script field, but feel free to upvote the issue.

    Go To Test (and vice versa) Support
    Tests and production source follows a naming convention, for example MyClass and MyClassTest. You can now press Ctrl+Shift+T to jump to the test (if you’re in production code) or jump to the production code (if you’re in the test). And if there is no test, then it will prompt you to create a new one. This works great in most cases. Of course, with Groovy it is not so rare to have several top-level classes in a single source file. In these cases the feature can sometimes get confused. Upvote the fix here if you want it to be just that much smarter in the future.

    More Code Completion and Intentions
    The “add static import” intention is nice for those who use a lot of static imports. Just set your cursor in a constant referenced from your code, press Alt+Enter, and viola… the constant is statically imported. Also, code completion is now available when creating an object using named parameters, which makes them a little easier to use. A whole bunch of other code completion issues were fixed as well, but these were technically marked as bugs not features. You can always peruse the release notes to see the whole story.

    Performance
    JetBrains claims that file indexing (typically at IDE startup) is now faster and that working with large Groovy files is more performant. It is hard for me to see a difference since I use the EAP versions and don’t currently work on any massive projects currently.

    Grails Code Generation & Completion (Ultimate Edition)
    Some small but nice things here. If you reference a controller action from a GSP, and that action does not exist, then pressing Alt+Enter creates an empty action for you. Also, the type inference for values on the GrailsPlugins has been improved, such as the closure parameters for doWithApplicationContext, doWithDynamicMethods, etc, and code completion for controllers and action in custom plugins are now discovered automatically. Finally, the code inside <r:script> tags from the Grails Resource plugin is now parsed as JavaScript, so full IDE JavaScript is available within them. This is supposed to become a standard for Grails 1.4, so it should continue to work with that release.

    Improved Grails Resource Bundle and i18n Support
    With 10.5, if you reference a property using the <g:message> tag in a GSP, and that property does not exist, then the property will be underlined in red and you’ll be given an Alt+Enter Intention to create it for you. Nifty. Also, the existing i18n intentions should now work better when you have GString syntax in your text. For instance, the string “Hello, ${user}” should now be properly handled when extracting to a resource bundle.

    Various Usability Improvements
    Last on the list are a few odds and ends around usability. Closures can now have the separator line between them in the IDE, the way methods show a line between them. GSP stacktraces have correct (and clickable) hyperlinks. The scripts folder is visible in the Grails view. And code navigation and formatting has been improved for several Grails Artefacts.

    That’s it. Enjoy the upgrade, may your solid state disk never fail, and may your caches always be valid. Caio!

    If you like this sort of thing, then there is also a whole bunch of other IDEA related content on my own blog and on the Canoo blog. Enjoy.