• Home
  • Events
  • About
  • JavaOne 2011 Thursday and wrap-up

    October 7th, 2011
    Opinions expressed in the post are solely my own and not necessarily those of my employer.

    Thursday started with the Community Keynote. Well, it actually started with a 25 minutes IBM presentation about their cloud story. This had obviously nothing to do with the topic of the event and later speakers pointed this out rather frankly. At least it was interesting to hear that there is a job title like “Cloud Architect”.
    The real part of the Community Keynote started with a quiet moment to honor Steve Jobs.
    Later on, various winners of the Duke choice award and JUG luminaries cared for a lighter mood again, presented their work and asked the audience for participation in their local JUGs and in the advancement of Java via the OpendJDK. The JavaPosse appeared on stage and presented a funny show.
    It was also announced that many of the JavaOne talks will be available on parleys.com, which provide by far the best experience when it comes to viewing live-captured talks.
    Afterwards I attended the ZeroTurnaround (JRebel) talk on classloader issues. The rather big room (~300 ppl) was packed and left the impression that many Java developers share a common pain around classloaders. It was a good talk, covering the basics and typical pifalls. The only surprise for me was *how* easily you can end up with a classloader leak.
    In order to improve my fathering skills, I went into Ken Sipe’s talk on “Rocking the Gradle”, where I met Adam Bien. Ken is a great presenter. However, convincing the crowd is a challenge especially as many Maven users seem to suffer from the Stockholm syndrome.
    Then onto “Visualization of Geomaps and Topic Maps with JavaFX 2.0”, which had some interesting visuals captured here.
    For me JavaOne 2011 finished with Jim Clarke and Dean Iverson on GroovyFX, where they made some really good points suggesting that Groovy is the best language to drive the JavaFX 2.0 API.
    As a side note, James Weaver introduced me to Jim Clarke by pointing out “He is from *Canoo*”. Then the discussion went into how well-known Canoo is in the community and that all employees must be true geniuses to achieve so much with so few people 🙂
    Fazit: Still, JavaOne is nowhere near where it was before the Oracle acquisition both in terms of size and in terms of being an unparalleled community experience. Distribution all over various hotels just doesn’t feel right. However, meeting friends has been and still remains the most important part of JavaOne and the conference still delivers on that account.
    Important topics were new Java versions, JavaEE (+cloud), and Java for the Desktop with 50+ talks on JavaFX. Whenever the audience was asked about which alternative languages they use, Groovy was the clear winner. It appears that in the mainstream, Groovy has become the default choice for dynamic programming on the JVM.
    The topic of concurrent programming was in my eyes underrepresented. Guillaume and myself had simple usage of GPars in our demos but for such a big and increasingly important topic the coverage should be much more extensive.
    Finally, some visual impressions.
    Good-bye SF
    Dierk Koenig

    JavaOne 2011 Wednesday

    October 6th, 2011

    Opinions expressed in this post are totally my own and not necessarily that of my employer.

    Wednesday started with the infamous “scriptbowl”, a competition between various scripting languages. This year the contenters were JRuby, Groovy, Scala, and Clojure. I wondered whether Scala considers itself a scripting language but obviously they either do or just seek the opportunity to be on stage.

    To keep a long story short: Groovy has won this event for the third time in a row! This year the race was tied with Scala. Guillaume presented Groovy in the typical Groovy-idomatic style and explained every single line of his concurrent visual analyzer for Google+ postings. Dick Wall presented only non-idomatic Scala code. I interpret this as: to make Scala appealing you have to make it look like Groovy. Furthermore, he presented Kojo, which is a great interactive learning environment written in Play/Scala. In contrast to all other presentations, this was not specifically created for the scriptbowl, nor was it written by the presenter, nor was it clear how much effort went into it, nor did the audience see a single line the implementation code. How much this skewed the comparison, I leave to everybody’s judgement. The show was good, though.

    I felt a bit sorry for Clojure. It is a great language and deserves a presentation that is more visually appealing to convince the crowd.

    Afterwards, I attended a hands-on lab for “rapid enterprise development with netbeans”, which was essentially creating a Swing app for database CRUD actions. If I remember correctly, I did the exact same task 1997 with JBuilder. It left me with the feeling of “Yes, it works” but it is not less complex than it was 13 years ago.

    Early afternoon Gerrit Grunwald (better known as @hansolo_) presented his work on simplified custom components for Swing. Given that he speaks about an activity that is both utterly important and highly underadvertised he would really deserve speaking at the center stage.

    Graeme Rocher’s great session about Grails, polyglot datastores (hibernate, jpa, redis, mongodb, …), and the cloud was overshadowed by the news that Steve Jobs has died. Accidentally, the demo application was about showing a BBC News stream, which displayed this information live on stage. Both the presenter and the audience were equally touched.

    The day officially ended with a big event at treasure island. I decided to not go there, though, and meet the former Canooey Denis Antonioli in Berkely where we had a great evening.

    Dierk Koenig

    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.

    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.

    IDEA series (ix) selective actions

    January 12th, 2011
    Working with selections

    Please note that this is for Groovy and Grails development on Mac OS X with Swiss-german keyboard layout and default keymap, so the keybindings may differ on your machine. (For Windows, you most often can replace Cmd with Ctrl)

    We have seen the editing support for lines, combined with selections. This part is more specifically about working with selections.
    know your keyboard navigation
    first of all, it is very helpful to familiarize yourself with your OS-specific keyboard commands for moving the cursor around and with the Shift key pressed, doing a selection. On Mac that is Cmd left/right for begin/end of line and Alt left/right for jumping over words. Of course you can use the mouse for selections but once you master the keystrokes, you will be faster and more precise.
    Cmd W (Shift for reverse)
    is widening the current selection. That is, if you already have a selection, it expands it to the next enclosing syntactical scope (expression, statement, block). Without a selection, it starts a selection at the caret.
    Mac users may expect Cmd W to close the current editor (internal window) as typical for mac applications, but that functionality is mapped to Cmd F4 in the standard keymap (somehow resembles the Windows keystroke).
    I use widening most of the time to select a small expression precisely – often for later use in a refactoring. I start in the middle of the code and hit Cmd W repeatedly.
    When selecting a larger block, let’s say a method or a whole class body, it’s efficient to place the cursor just after the opening brace and hit Cmd W just once to select the whole block.
    Cmd Alt T
    surrounds the selection (or current line if there is no selection) with a live template. This features spares you the need for fiddling around with cursor positioning to put some code into an “if” block and the likes. I even made my own templates for surrounding a selection with parentheses, brackets (to make a literal Groovy list), braces (to make a closure or block), single quotes, and double quotes.
    Especially putting quotes around a selection is nice since otherwise IDEA sometimes inserts pairs of quotes when it shouldn’t.
    Context menu -> Compare with Clipboard
    when you have a selection and open the context menu (right mouse click) you’ll see a “Compare with clipboard” entry, which opens the internal diffing view. Nice.
    keep groovin’