Meet the experts at codecentric

Yesterday, we had the first “meet the experts” at codecentric, featuring 4 talks, open space, lots of food, and several Guitar Hero battles.

First for the official part – we had 4 talks about the following topics:

  • Performance Antipatterns – Mirko Novakovic, codecentric
  • Live performance tuning – Kirk Pepperdine
  • The secrets of concurrency – Dr. Heinz Kabutz
  • Continuous performance management – Alois Reitbauer, dynatrace

While I had already heard Mirko’s talk a couple of times (not hard to imagine, he’s given the talk on conferences as well as in-house at codecentric), the other talks were new to me both from a technical point of view as well as from the personal point of view. I did know Alois before, though.

Meeting Kirk and Heinz was a really nice experience – Kirk demonstrated live how to do performance analysis using basic, free tools, which was great fun to watch. Heinz explaines his ten laws related to concurrency, including “The law of Cretan Driving” which Heinz explained by some very funny storys and pictures of road traffic in Greece, especially Crete where he lives and works. Listening to his talk, I was quite happy that I’ve never had to do anything concurrency-related myself in web development :-)

In the open space, I learned why Hibernate wins over Toplink, which was in fact rather a history lesson than a direct feature-based shootout – actually, I’m a bit sad that there is basically no “recorded history” of software, open source etc. I also learned that the majority of Eclipse committers works at IBM, which I didn’t really know before – but if you look at Eclipse commits or issues, you do find a lot of IBM people there ;-) I also went to another open space session held by Heinz Kabutz where he spoke about his lates puzzle and some other newsletter topics – visit JavaSpecialists.EU if you’re interested – it’s packed with interesting topics.

In between the open space sessions, we had some really great food, as well as during the day – the evening catering was even more fun because the entire setup was moved from our building to the outside where we spent a really great time eating, chatting away and drinking. As usual, the codecentric team partied hard, supported by participants, the invited experts and a couple of guys from dynatrace. It was quite nice to have some relaxed conversations, and the weather was just absolutely perfect!

Last but not least, I’d like to mention the open space highlight of the day, announced by my workmate Nick – because “performance” was the topic of the day, he announced an open space session called “Performing on Guitar Hero” which turned into quite an entertaining event. We saw Kirk, Jeroen (Xebia) and a couple of other people overcome the initial frustration and then happily rock away, battling each other – there were quite a couple of cheers and hard laughs involved :-)

I’d like to thank codecentric for organizing this event, and I’d also like to thank both the experts and the participants for making this a very interesting and memorable day. I’m looking forward to the next two “meet the experts” events!

Sorry for lots of text – I think that appropriate images will be published on our company blog next week, as soon as everyone is back at the office. Thanks for your attention :-)

Saturday, June 27th, 2009 Random Thoughts 1 Comment

Galileo vs. SVN

Still no “built-in” SVN support. Same song as ever? Almost. SVN Team Provider is now available via the Galileo update site, but:

Subversive SVN Connectors distributed from external location. Such scheme of distribution caused by licensing requirements.

Gnah!!! Source

Ok, so this time I picked “latest release” (there is no Galileo release available yet) and chose the SVNKit Connector with the highest version available. Seems to work. Still foobar though…

Tags:

Thursday, June 25th, 2009 Random Thoughts No Comments

NetBeans 6.7 RC3 – it’s alive

Following Petr’s comment on the previous post, I filed a bug report for the NetBeans 6.7 RC3 installer on Windows XP today. By ignoring this:

NetBeans 6.7 RC3 installer warning

NetBeans 6.7 RC3 installer warning

and by clicking “Ja” (Yes) I managed to make the installer do its job. However, this only worked after a system restart – somehow, there were obviously still stale processes floating around before the restart.

I’m now going to retest the Grails support. Hope it works. :)

In the meantime, I recommend reading this one and the other posts on Petr Hejl’s blog.

Tags: ,

Sunday, June 21st, 2009 Random Thoughts No Comments

Grails IDE fail

I’m trying this and that with Grails at the moment, and I was willing to find out which IDE I should use on Windows. “The Definitive Guide to Grails” mentions Eclipse and Netbeans, giving Netbeans an advantage because the Eclipse Groovy plugin is still under heavy development. Okay. I don’t want to frustrate anyone or bore the reader with long stories, here’s the results after some hours of testing the proposed IDEs:

  • Netbeans 6.5 works out of the box, but seems to be buggy, or maybe Grails 1.1.1 is buggy. I got lots of stupid errors stating problems like “xy is not a domain class”. My browser (Firefox 3) went crazy opening a new tab every couple of seconds when I ran the Grails application. On top, Netbeans did obviously not really kill the Java processes it created when I clicked “Run Application” – in the end, I had to manually remove 6 Java processes until I could do a “clean start” of my Grails app. No good. Netbeans seem to suck anyway, I had lots of problems with it in the past.
  • Netbeans 6.7 RC3 won’t install on my computer, the installer does either nothing at all or it goes into Nirvana, leaving a stale Java process behind.
  • Eclipse Ganymede lets me install the Groovy plugin (I tried the latest development build as well as the stable release), but that’s pretty much all that works. Check out this article if you want to know which manual steps have to be done in order to get it working at all – okay, I would have gone through this, but I was stopped quite early because of several internal plugin exceptions telling me that a couple of classes were missing and that this-and-that could not be executed. Gosh.

I’m tempted to say that RadRails (now Aptana etc.) for Ruby on Rails development was pretty much of a kick-ass application, also Eclipse-based, and I’m quite unhappy with the state of things when it comes to Grails IDE integration…

Looks like my choices are:

  • Buy IntelliJ IDEA
  • Buy a Mac and try Textmate

Both no option. So I think I’ll go on with a plain text editor.

If anyone has a working Grails IDE based on Eclipse or Netbeans, let me know!

Tags: ,

Saturday, June 20th, 2009 Random Thoughts 1 Comment

Google Calendar – Thunderbird – Lightning

I just succeeded in making my Google Calendar usable from Thunderbird. It took only some easy steps:

  • Install “Lightning”, a Thunderbird calendar addon
  • Install “Provider for Google Calendar”, an extension to Lightning
  • Copy the private XML URLs of my calendars in order to create corresponding calendars in Lightning

The provider for Google Calendar is the most important component because it enables bidirectional communication with Google. Lightning itself can only read calendar entries.

If you need more info on this, try Google ;)

Update: It’s not really working atm, I’m repeatedly asked for my Google credentials when I start Thunderbird. I posted a question related to this problem, currently waiting for an answer.

Sunday, June 14th, 2009 Networking No Comments

Basic Reflection Magic, and BeanUtils too

In my current project, a good deal of my daily work goes into an often repeated sequence of tasks:

  • Read data from an XML file (so-called “structured content”, OpenCms)
  • Put the data into an object tree in order to do stuff with it
  • Put the object(s) on a JSP page context in order to display parts or all of the contained data.

The old way was a bit less comfortable, being heavily based on Maps and Lists that were filled with single elements of the structured content and that then had to be parsed a second time in the JSP. I like the use of transfer objects a lot better because it keeps the code clean and easy to maintain and because it’s easier to apply modifications to the data between reading it and displaying it.

Thus, I’m searching for a nice way to get the cleanest, most concise code for the XML -> object tree step. For simple tasks, I make havy use of BeanUtils at the moment. Let’s say the XML contains elements called “title”, “link” and “image”. I then create a class with exactly the same attributes and sensible types (in this case, they are all Strings, but I do use boolean and numeric values in some places).

Because the attribute names in the class are the same as they are in the XSD, respective XML file, I can then easily populate an instance of my class while reading from the XML at the same time, roughly like this:

PropertyDescriptor[] propertyDescriptors = 
    PropertyUtils.getPropertyDescriptors(Teaser.class);
 
Teaser teaser = new Teaser();
 
for (PropertyDescriptor pD : propertyDescriptors) {
    try {
        String xmlPath = /* create basic XPath here */ + pD.getName();
        BeanUtils.setProperty(
            teaser,
            pD.getName(),
            document.getStringValue(cmsObject, xmlPath, currentLocale)
	);
    } catch(...) {} /* Exception handling and logging omitted for brevity */
}

This code is partially specific to the OpenCms API, but I think you get the point.

In most situations, you would probably get the PropertyDescriptor array only once and put it into a constant, because it’s not very likely that the transfer class will change during runtime.

This way of saving about n-1 lines of code where n equals the number of attributes you want to read from the XML makes me very happy.

But, as with every solution, I’m still looking to improve this even more. The downside at the moment is that I cannot remove loops yet for lists of entries in nested XML files. Thus, I did some research + experimenting on reflection mechanisms today. My intention: to pass the top-level transfer class into a method that recursively checks the structure (e.g. dives down into lists of other custom transfer classes, e.g. List or whatever) of my desired object tree and that then goes ahead and slurps the entire XML into an object tree. This should – in the end – fit into only a couple lines of code, allowing for a clean API and perfect encapsulation of reusable “please-read-this-XML” code.

First experiments were quite successful and I recommend this article: Java Reflection: Generics, especially section 4, “Generic Field Types”.

I’ll omit my code snippets here, because it’s much more fun to build stuff like this yourself ;-)

I’m quite fascinated by the inner workings of reflection at the moment, and I suppose that I will research this topic until I have a working bit of code – only to then find some proven framework that does the same thing – but maybe my small, self-made solution is just so small and simple that it does NOT require me to put an extra 10 JARs into the project… or maybe the idea turns out to be complete crap – we will see. Essentially, it’s all about having fun with technology :-)

I’ll write a follow-up as soon as I have new results. Stay tuned!

Tags:

Wednesday, May 6th, 2009 Development, Technology No Comments

QuickPWN translation

I just applied some corrections and some improvements to the german translation of QuickPWN – the current translation is a desaster and the new version had some minor glitches. Hope it helps. :-)

Tags:

Sunday, March 22nd, 2009 iPhone No Comments

JDK5 vs JDK6

Yesterday, I published an entry on our company blog about a funny finding during JDK5 to JDK6 upgrade. There might be more to come during the next couple of weeks, so if you’re interested in such stories, keep an eye on the codecentric blog :-)

Friday, February 27th, 2009 Recommended Readings No Comments

Eclipse 3.4 (Ganymede) vs. SVN

If you’d like to freak out a little, try getting Ganymede to be SVN-capable. I can only say this much: choose Subversive (what else) and the latest SVNKit implementation and you will be likely to have few problems. Finding out which connector to pick (3 alternatives, 2 versions each) can be a pain, though. Many people have blogged about this, for example my workmate Nick. For more, try Google.

3.5 Steps to heaven (the first doesn’t count because the instructions posted there didn’t really work for me):

  1. Go to eclipse.org and be confused
  2. Go to Polarion and add the Ganymede update sites to your Eclipse
  3. In Eclipse, go to Help -> Software Updates and pick at least “Subversive SVN Team Provider” from “Ganymede” -> “Collaboration Tools”, then from the Polarion update site, category “Subversive SVN Connectors”, pick “Subversive SVN Connectors” (didn’t do much for me, I still installed it though) and “SVNKit 1.2.0 Implementation”
  4. Install, restart Eclipse, be happy.

Eclipse and SVN is by far the worst Hide and Seek game I’ve ever played in 2 years of working with Eclipse :-)

Tags:

Sunday, February 8th, 2009 Development 1 Comment

Hibernate cascade options

I just read about 85% of the Hibernate reference documentation because I couldn’t find any information on the cascade options you can set in your mapping file. Here’s what I found and where I found it:

Chapter 5.1.12 “many-to-one”:

Setting a value of the cascade attribute to any meaningful value other than none will propagate certain operations to the associated object. The meaningful values are the names of Hibernate’s basic operations, persist, merge, delete, save-update, evict, replicate, lock, refresh, as well as the special values delete-orphan and all and comma-separated combinations of operation names, for example, cascade="persist,merge,evict" or cascade="all,delete-orphan". See Section 10.11, “Transitive persistence” for a full explanation. Note that single valued associations (many-to-one and one-to-one associations) do not support orphan delete.

Section 10.11 does indeed explain quite a lot about cascading. I simply wanted a collection of child objects to be deleted as soon as the parent is deleted, so I’ve now set the cascade option on the list mapping to “all, delete-orphan”.

Tags:

Wednesday, January 14th, 2009 Development, Java No Comments