Back blogging

The last one and a half months I didn’t find time to write articles although I had several topics in my mind because other activities kept me busy:

First, I had been in a customer engagement with a busy schedule. It was JSF project and I was called in late to help out before the imminent release date. Working with JSF again included lots of workarounds, especially yet another workaround to get the GET verb working. I guess I’ll write a bit about that project here in the next days.

Second, vacation! Yes, I managed to have some vacation and even managed to get it in sync with the busy schedule of my wife.

Third, I’ve been talking with several startups lately. The economy is on the rise in Germany and the risk averse tendencies of the last five years are finally starting to ebb away. And Ruby gets some attention as well :-)

Fourth, a busy private schedule with lots of appointments and meetings (which I might talk about later on as well, but probably on an other blog).

But since there a several topics in my queue now, I will be blogging more often in the next weeks.

Published 08/05/2007 at 04h29

Who has done large scale JSF projects?

Whether successful or not, have you been involved in large scale JSF projects?

If yes, can you share some project statistics with the blogosphere and me in particular?

  • The number of managed beans?
  • The number of views?
  • The number of custom components?
  • The load on the server(s)? How many concurrent users?
  • Which JSF implementation did you use?
  • Did you use RAD tools?
  • What where your pain points?
  • What do you think is JSF’s sweetspot?
  • Have you had concerns with bookmarkability?
  • Would you write your next web-application using JSF and, if not, why not?
  • Can you give a short description about the project?

I have been looking around for descriptions of real world JSF projects on the web but haven’t found many articles, so if you feel you can answer some of the questions above, please leave a comment or a trackback.

P. S.: If I have missed the definitive resource on projects done with JSF in my search, please tell me so.

Published 12/03/2007 at 11h30

My favorite eclipse classloading annoyance is fixed!

Yesterday evening I have spent about two hours helping an intern on an Eclipse problem.

Eclipse (3.0, actually IBM RSM 6) reported a NoClassDefFoundError for a class from one of the plug-ins.

I know that Error, I have had it before, and I dread it. Because this NoClassDefFoundError is a hoax! I got this error when the start method of the Bundle Activator would throw a NullPointerException when it was called because a class of that plug-in was requested. And yesterday evening it turned out to be a ClassNotFoundException for a class which was reported as a NoClassDefFoundError for the same class. The reason the class was not found was that the jar file containing the class was referenced under the wrong name in the manifest. Such things can happen. But throwing a NoClassDefFoundError instead of a ClassNotFoundException doesn’t make it easier to find the cause for the exception.

Today I took a look at the code (org.eclipse.osgi.framework.internal.core.BundleLoader.java) and found that there have been recent changes to it. Before, the findLocalClass method would try to call findLocalClass on the ClassLoader and return the class. It would also catch an ClassNotFoundException and return null. It wouldn’t log the exception or anything, just return null as if nothing exceptional had happend.

Now, the classloading mechanisms in OSGi are complex and the ClassNotFoundException can actually happen without causing a lot of trouble, because other classloading mechanisms will be called after “findLocalClass”.

The version currently checked into eclipse’s cvs repository will not only catch the ClassNotFoundException, it will also rethrow it. But only if it is a special TerminatingClassNotFoundException, a subclass which is constructed when the plug-in could not be activated which contains the actual exception as cause. This is great, because will can now see if the there actually was a NoClassDefFoundError or if the plug-in startup failed due to some other exception.

Still, I would really love to have anther patch in that code:

All ClassNotFoundExceptions which are not TerminatingClassNotFoundException should at least be logged. That way you could easily check the debug output without resorting to finding a log message “BundleLoader[BUNDLENAME].findLocalClass(CLASSNAME)” not followed by a “BundleLoader[BUNDLENAME] found local class CLASSNAME” but rather just look for the message telling you that the bundle you expected to find the class did not find it. So every time you get a NoClassDefFoundError, you could just swtich on the DEBUG logs and grep for the culprit class.

OK, it’s not much of an improvement, now that we have TerminatingClassNotFoundException, before this new excpetion I would have given, hmm, some money (not too much, though) for having that log message in there!

I have filed an feature request with an attached patch at eclipse.org ( 176828 ).

Published 09/03/2007 at 10h05

Q: What is almost as bad as a Singleton?

A: A class that has only static methods but also has (static) state.

In Java you often see XyzUtil or XyzHelper classes which only provide static methods (like, e.g., StringUtil from jakarta commons lang). These classes provide helper methods which usually act on an object which is passed along as an argument to the methods.

(Excursion: Java needs these static utilities because we can neither add new methods to a class without subclassing it and often cannot subclass the class we want to extend, like String, which is final. Ruby [and other languages] do not have this problem, since they provide the possibility to open a class and modify it or to use modules to mix in more behavior)

I don’t want to go into the question why I deem Singletons to be evil (I’m not the only one, just google for “Singleton evil”).

Now, a class which only has static methods and has a state is (imho) as bad as a Singleton, because it actually only is a Hidden Singleton, a way to work around the fact that the coding guidelines for a project don’t allow Singletons.

In the case I just stumbled upon such a hidden Singleton was used to retrieve a configuration object and to lazily create it, if it was not created before. So the first call to getConfiguration() created and stored (on a static field) a Configuration instance, and each further call just returned that instance. Now, first up, a getter should be idempotent anyway, but lets leave that aside. The class worked well in production settings. The first time the configuration was requested, it was created (which takes some time), afterwards the cached instance was returned. But during testing everything goes wrong. Using such a Hidden Singleton allows for the testing of only one Configuration. I can’t say: run this testcase with that configuration and this other testcase with that other configuration. The configuration was already loaded and won’t be modified.

So I either need a way to null the cached configuration on the Hidden Singleton, or need to get rid of it and replace it with some other pattern. What you usually want in such a setting is IoC, someone should simply set the configuration on all instances which need it (and such making those objects conform to the law of demeter, because they don’t need to fetch the Configuration from some other class). If you don’t have an IoC container, you might use a factory pattern to alleviate the pain the Hidden Singleton is causing. Use a factory to create the objects which need the Configuration. The factory can set the configuration on the objects during creation, and the configuration can be passed to the factory method (and, if really necessary, cached inside the factory until a different configuration is passed along…)

Published 06/03/2007 at 06h20

A long tail for contemporary classical music

Yesterday I’ve been in a concert of the orchestra my wife is playing in and my seat neighbor was fascinated by the first two pieces of the evening (Siblius 4th Symphony and Ligetis “Mysteries of the Macabre” for Trumpet and Chamber orchestra).

He said that he would love to have the recordings of these two pieces, but thought that there wouldn’t be a CD available, because they wouldn’t sell enough of that CD to make it worth producing the CD. Which made me think. My wife’s orchestra is a radio symphony orchestra, i. e., they were founded by a radio station60 years ago and (almost) all of their concerts are broadcast live or recorded and broadcast later on.

They also produce CDs, but, as expected, not of every concert they are giving.

Now, there are a lot of recordings of Sibelius 4th Symphony around, with the Ligeti piece it’s getting more narrow. But why shouldn’t it be possible to get the recording of that specific evening? The recording exists anyway and will be broadcast on May 4th at 20:03 CET. Now, instead of (illegally) recording that broadcast, some people would be willing to pay money to download the recording from the orchestras’ homepage.

It shouldn’t be too hard to setup a store for the recordings after they have been converted. Surly, there are rights issues (what if the soloist or the conductor have contracts with record companies etc…). But solutions could be found eventually.

This is would be a case for the long tail. The recordings are resources that could be tapped by selling them on the internet. If the conversion to a suitable format could be automated, the price wouldn’t even have to be that high.

And since this orchestra has done more than 400 world premiers since its inception 60 years ago, there are a lot of recordings of pieces that probably have not been recorded by anyone else.

Published 02/03/2007 at 07h56

Project Types

What kind of project are you or your company after and what kind of company or freelancer are you?

How do the projects you have done so far affect prospect future projects? Are we typecast (that company only provides single specialized consultants while this staffs whole projects) or can we shed and acquire new “images” easily?

This mindmap is the result of some of my thoughts on project types and company types.

Project Types

What do you think?

What are the pros and cons of going for:

  • specific technologies
  • specific verticals
  • specialized consultants

as usp? What about being an “agile” programmer / company?

Published 01/03/2007 at 12h20

Happy (chinese) new year, everybody!

Welcome to the year of the pig.

Published 18/02/2007 at 06h32

Browsing through the local bookstores

I’ve been browsing through the local bookstores yesterday and have been looking through the programming and IT sections. The two big bookstores I’ve been in both still haven’t got a section for Ruby. There are sections for everything you might (or then, might not) be looking for, Perl, PHP, Python, Java, C#, Joomla, Mambo, ActionScript etc. At the first bookstore I found one book about Rails, the other had four or five. Both had them filed under general programming. Both did not have a single book about Ruby (“The Ruby Way”, the “Pickaxe”, nothing).

That makes me question:

  • How big is the acceptance of Ruby in Germany? and
  • How big is the acceptance of Rails in Germany?

I have seen a few articles about Rails in german language magazines, but I somehow have got the feeling, that Ruby and Rails haven’t yet arrived in Germany yet.

Am I right? Or do I just look in the wrong places? At least there are 139 people from Germany registered at workingwithrails (as of today).

Workingwithrails lists two other developers in Freiburg, Germany. Maybe three is enough to start a ruby brigade? We’ll see.

Published 18/02/2007 at 06h23

My thoughts about "JSF is way too complicated?"

Imho, JSF is not too complicated. JSF was conceived for specific goals, and I think that JSF matches these goals very well. When you want to develop a java web application and can follow the path that JSF has laid out for you, you are well served. Integration with IDEs is available, RAD support, drag and drop development, it’s all included in the package. So, yes, JSF is not too complicated, if you use it the way it should be used.

JSF, e. g. , abstracts away the low level request-response layer inherent in all applications delivered over HTTP. I agree with Tim Shadel that the abstraction is leaky, but maybe programmers new to web development have something to gain from this abstraction.

It is only when you leave the troten path, when you make design decisions that were not considered in JSF, that JSF gets complicated. And even then, it is not actually JSF that gets complicated, but the fact that you have to work around a framework which was supposed to help you. It gets complicated because you have to dig through the seven layer burrito down to the request and the response to do what you want to do. Managed beans in request scope and bookmarkable URLs are, in my experience, things that have either not been considered in JSF, have been omitted on purpose or were, to the JSF creators, on the fringe of things considered necessary for a web framework.

I have done web development in Java since about eight years, starting out with Servlets going over JSP to JSF. I have also done web development in Perl, PHP and Python. And I currently do all my off-work projects in rails. Having worked with different frameworks written in different languages, I feel like there is a sweetspot between abstraction and allowing easy access to low level HTTP. And that sweetspot surely isn’t universal. But it seems that I share the same sweetspot with a lot of programmers. For me it’s rails. BUT: that does not mean that I would say that JSF is bad! It is just not a the level of abstraction I would like to work at.

Published 18/02/2007 at 06h16

On the Move...

…that is, on this Move. This is what I spend a great deal of my time on:

Move

The one in the picture is our own Move, but I’m lucky to have one at the office as well. If you have the chance to test one of these chairs, do so. And take more time than just five minutes. This chair really keeps you in motion, even during long coding sessions. And that keeps the stress away from your back. Though it might lock like it should hurt to sit on a Move for more then 15 minutes, my back is relaxed even after ten hours.

Nonetheless, I wouldn’t say that you don’t have to do regular workout, even when you have one of these.

Published 12/02/2007 at 15h40

RSS