Wednesday, May 30, 2007

People Using Spring, EJBs Don't Know Basic JDBC

I recently found a bug in software we are developing. I traced it and found the root was improper JDBC handling. The application is written using EJBs, Spring and plenty of other relatively complex technologies. I was surprised that developers who were able to use all those technologies had no understanding of basic JDBC.

They fetched all the data (including double, decimal numbers) from the database as String using rs.getString() !

While this is most of the time possible, it is also most of the time not desirable (in the code they were actually converting it to numbers, etc.). More importantly, this can lead to nasty bugs due to different Locales (the . vs , game for example). And this is what's happening in our application.

People Using Spring, EJBs Don't Know Basic JDBC

I recently found a bug in software we are developing. I traced it and found the root was improper JDBC handling. The application is written using EJBs, Spring and plenty of other relatively complex technologies. I was surprised that developers who were able to use all those technologies had no understanding of basic JDBC.

They fetched all the data (including double, decimal numbers) from the database as String using rs.getString() !

While this is most of the time possible, it is also most of the time not desirable (in the code they were actually converting it to numbers, etc.). More importantly, this can lead to nasty bugs due to different Locales (the . vs , game for example). And this is what's happening in our application.

Wednesday, May 16, 2007

Wizards Bad For Productivity

IBM RAD comes with many wizards, to create EJBs, to create Web Services, do struts mapping... They are quite well done, making EJB < 3.0 usable, and Web Services look simple.

But wizards sucks at:
  • typos correction
  • repetition

But when you do a typo in your wizards, then all the files generated/changed are wrong, and you don't necessarily know if you can just do a search and replace. Plus you don't necessarily know all the files that were affected by the typo.

In RAD, there is even a wizard to help you create a JSP. What does it do? Well, for example it generates those 2-3 lines of tag libraries include. The first time you write a JSP, it might help you, but the second time, it's much faster to copy/paste. Generally, when you have to do an wizard operation many times, it is much slower than doing it via copy/paste and few modifications here and there, or to use a more configurable alternative like XDoclets.

The other complaint I have about wizards, is that they hide too much how things are working. As anybody can use them, it makes you think the operation it does and technologies behind are simple.

More generally it feels to me like wizards are only there because of some over-complicated design somewhere. EJB 3.0 are much nicer to work with than EJB 2, a wizard will help you much less with EJB 3.0, and yet EJB 3.0 are more powerful.

Wizards Bad For Productivity

IBM RAD comes with many wizards, to create EJBs, to create Web Services, do struts mapping... They are quite well done, making EJB < 3.0 usable, and Web Services look simple.

But wizards sucks at:
  • typos correction
  • repetition

But when you do a typo in your wizards, then all the files generated/changed are wrong, and you don't necessarily know if you can just do a search and replace. Plus you don't necessarily know all the files that were affected by the typo.

In RAD, there is even a wizard to help you create a JSP. What does it do? Well, for example it generates those 2-3 lines of tag libraries include. The first time you write a JSP, it might help you, but the second time, it's much faster to copy/paste. Generally, when you have to do an wizard operation many times, it is much slower than doing it via copy/paste and few modifications here and there, or to use a more configurable alternative like XDoclets.

The other complaint I have about wizards, is that they hide too much how things are working. As anybody can use them, it makes you think the operation it does and technologies behind are simple.

More generally it feels to me like wizards are only there because of some over-complicated design somewhere. EJB 3.0 are much nicer to work with than EJB 2, a wizard will help you much less with EJB 3.0, and yet EJB 3.0 are more powerful.