All | Technology | Entertainment | Java | Politics | XML | Travel | Ajax

20060202 Thursday February 02, 2006

Tools for debugging Ajax

When Joe Walker (the creator of DWR) visited Stockholm last week, he got a question during the Ajax seminar what tools there were for debugging Ajax. He whipped up this list of tools and techniques: Finally, this kind of code:

   if (window.console) window.console.log(message);
   else alert(message);
Then we have the newly released FireBug.

(2006-02-02 17:23:21.0) Permalink Comments [0]

20060201 Wednesday February 01, 2006

All exception constructors should take a String parameter

I've spent several days in code reviews. I kept seeing Exception classes with empty constructors, and that just drives me nuts. I also saw exception constructors taking only a Throwable. That drives me nuts almost as bad. After a few days I realized what the programming recommendation should be: They may take more than a String, of course, such as a Throwable, or an extra int, but there must be at least a String parameter.

Oh, and programmers that write
   throw new FooException("");
should be flogged.

(2006-02-01 17:52:36.0) Permalink Comments [3]

Java Open Source CMS

I've known about the pretty amazing Open Source CMS site for a while, but recently bumped into the CMS Matrix. I spent an hour or so browsing throgh all the entries, ten by ten, listing all of the open source Java products. Here they are, in case anyone is interested: Maybe I'll evaluate them later on. It would be great if there was a Java contender to Mambo and Joomla!

(2006-02-01 16:21:26.0) Permalink Comments [3]

20051215 Thursday December 15, 2005

My Swedish Ajax site is now online

Registered the domain about 2 months back, then spent much too much time experimenting with the layout and CSS. I'm sure as hell an amateur at web design, but it's fun. Finally it is online at

I keep adding blogs, examples and articles, and it has turned out to be much more work than I first anticipated. I have huge respect for editors running web sites on their free time. It is hard work to keep such sites alive.

(2005-12-15 17:40:47.0) Permalink Comments [0]

20051214 Wednesday December 14, 2005

The Java Web Framework Grand Challenge

Ajax has certainly stirred things up! This last summer I was thrilled about Wicket, as the lean and mean new kid on the web frameworks block. I never got to know it in detail, and now I'm not so sure about anything any more, since I don't know if the current web frameworks are well suited to handle the brave new Ajax world. Sure, Ajax will not change the world. Not even stop world hunger, but I strongly believe that end user demand will force us all to add Ajax to our web applications. Not because we have to, but "because it's there". It is really quite simple to use, and the effect is really addicting. It sure looks like magic. If you've never dipped your toes into Ajax, and you're into Java, I'd recommend DWR. It works well, has an active and helpful community, and is quite well documented.

But lets pretend Ajax never happened. Lets look at the current web frameworks landscape. I think these are the current contenders: I may have forgotten one or two, but that isn't the point. There are a few good comparisons, like this and this, but none of them goes the whole way!

Lets look at the boundary conditions! Picking a web framework for Java should be done depending on how you answer these questions: I may have forgotten one or two, but that isn't the point. The point is that noone has taken The Java Web Framework Grand Challenge and told us in which circumstances they fit best! I'd love it if someone was bold enough to write a flowchart with yes/no questions that leads to recommended Java web frameworks. This is your chance to fame and glory!

(2005-12-14 17:55:09.0) Permalink Comments [2]

20051212 Monday December 12, 2005

Badly missing book: JavaScript for Java programmers

I'm really lost when I code in JavaScript! I stumble on each and every small difference between Java (which I know well enough to do in my sleep) and JavaScript. It can't be just me! I wish there was a book that could: I'd buy it straight away, and I think many others would too, since JavaScript is a cornerstone of Ajax.

(2005-12-12 17:13:46.0) Permalink Comments [1]

20051124 Thursday November 24, 2005

Java history was made today!

Today Java overtook C++ as the language with most projects on SourceForge! Here is the current list for languages with more than 1000 projects:
  1. Java (16738 projects)
  2. C++ (16731 projects)
  3. C (15934 projects)
  4. PHP (12175 projects)
  5. Perl (6209 projects)
  6. Python (4542 projects)
  7. C# (2892 projects)
  8. JavaScript (2779 projects)
  9. Visual Basic (2192 projects)
  10. Delphi/Kylix (1926 projects)
  11. Unix Shell (1845 projects)
  12. Assembly (1608 projects)
  13. PL/SQL (1145 projects)
The next big thing since sliced bread - Ruby - is at a whopping 400 projects. Much less than Objective C (739), but more than Lisp (323) and even Pascal (357)! Java really needs to worry.

(2005-11-24 08:11:55.0) Permalink Comments [25]

20051116 Wednesday November 16, 2005

Evaluation of COM to Java bridges

At work we needed to access a COM object in a DLL from Java. We started out using the open source Jawin tool, but unfortunately we never got it stable. My unit tests failed about every second time. So we ended up buying a license for EZ JCom, which despite its corny name turned out to work great.

(2005-11-16 17:24:39.0) Permalink Comments [7]

Don't buy your watch at, unless... have good nerves. Their prices are good, but they never answer emails, and they charge your credit card/PayPal first, then order the watches from their suppliers, then ship it to you. Illegal practice, I think, but my Tissot T-Touch finally arrived. It is sweet. Now I only need to figure out how to adjust the strap, or grow massive wrists.

(2005-11-16 17:18:57.0) Permalink Comments [0]

20051103 Thursday November 03, 2005

Why not DB access a la OGNL?

At work I recently needed to save a simple timestamp to the database. While writing all that code for that simple task, I asked myself why this couldn't be done a la OGNL. Perhaps something like this:
   OgnlDb db = new OgnlDb(jdbcUrl, jdbcUser, jdbcPassword);
   db.update("mydb.thetable.last_changed = ?", new Date());
   Date lastChanged ="mydb.thetable.last_changed");
   // Or a more complex update:
   db.update("mydb.customer[name='steve'].zip = ?", 12345);
   // Or even when there's a separate address table joined to the customer:
   db.update("mydb.customer[name='steve'] = ?", 12345);
Wouldn't that be a great tool for simple DB access?

(2005-11-03 07:39:12.0) Permalink Comments [3]