Main

Java Archives

October 13, 2003

"Point-and-click" Software Development

I saw a presentation today from BEA on the Weblogic Workshop. The tool was pretty nice, but it crystallised an idea that has been kicking around in my head for a while now. Quite simply, I'm not sure these sort of tools are good for development use.

The idea behind the tool is that for every decent software developer out there, there are at least 10, maybe a lot more, who aren't very good. These "developers", often stereotyped as VBA programmers, are people who can do a decent drag-and-drop interface, but can't really build anything complex, either due to lack of native ability or due to lack of training. This was especially true during the dotcom-craze, when millions of people worldwide tried to get into IT when they really didn't have a natural aptitude for it.

(To any VB programmers reading this, I won't apologise. VB has an immense number of followers, many of whom can't code their way out of a wet paper bag. OTH, there are also some very good VB programmers; no stereotype is absolute. There are also a lot of crap Java programmers)

The problem is that there aren't enough good developers out there. The BEA guy gave numbers of about 2 million decent developers vs 15-20 million "HTML hackers", world-wide. I'm not about to question the numbers; certainly, the ratio is either right or optimistic.

It's a well known principle of software development that good developers are considerably more productive than the average, and one of the reasons is that the average is pulled down a lot by the bottom end. The bottom end developers really aren't capable of anything more complex than doing form-based, VB-style of development. In fact, many of them do VB-style of development. However, with MS shifting VB over to VB.NET, many of these people aren't going to be able to make the jump. So BEA came out with the WebLogic Workshop, in the hope of being able to steal some developer marketshare.

All of this is well and good, and to be honest, the Workshop would allow an inexperienced or mediocre programmer to pull together an app quickly. However, these tools don't remove the fundamental complexity of the problems; they only hide it. And that's where the problem occurs.

Take a typical team: 4 to 5 junior programmers, and one senior lead programmer (who is probably with less than 10 years experience, maybe even less than five). The 4-5 junior people are going to be cranking out code, and the senior person is going to spend his or her time reviewing a lot of it to make sure that it's okay and no design flaws have crept in. Now, these 4-5 junior people are keeping the senior person very busy, and the senior developer still needs to crank out the "sensitive" code; the stuff that has to work. Now double the junior developers productivity (or even just increase it by 20%). What happens?

In an ideal world, the team starts becoming more productive. However, the world isn't ideal. In fact, what really happens is that the senior developer can't keep up anymore. The junior staff won't have their work reviewed, or the sensitive stuff slips. Defects start slipping through, hopefully to be caught by a testing team. Most of these defects will be to do with special cases, or with scalability/reliability constraints. In the end, an apparently functional application is built and delivered, but underneath, it's very brittle (just like a lot of VB apps, by coincidence). Quite possibly, the application spends a lot of time in the test cycles, eating up all of those productivity gains. And the junior staff won't be able to fix the bugs, because they won't understand the technology underneath the covers.

The other problem here is that a certain percentage of those junior staff can make the transition to journeyman status; not all, but a reasonable amount. But they won't be able to accomplish it if the real complexity is hidden. They'll never come to grips with the concepts behind the code that make the transition possible. Potential cut short. :(

These tools have a strong place. But I wouldn't want to use them on my mission-critical apps, and not on many of my non-mission-critical apps. If it's a small app, and it will only take a few days, then knock it up with these tools; small investment, small risk. Anything bigger, think twice before doing it like this.

Now, I'm not old enough to remember the debates when 3GL languages were introduced. However, I suspect that the current point-and-click style of tools are at a similar state to the early 3GLs. The first ones introduced more problems than they solved. But they won through in the end, as problems became too big to deal with in assembly code and the 3GLs became more sophisticated. The true crossover point came when it was possible to write a compiler for a language in itself (you can even do this in Java, including writing a JVM in Java (admittedly, it would have to run inside of a JVM, but you could do it)). When these point-and-click tools become sophisticated enough to do that, they'll have made it.

(A secondary problem is that graphical/visual interfaces aren't necessarily any better at organising complexity than normal OO code... But that's another issue, for another day).

That's all for now. Thanks for reading.

October 20, 2003

JUnit and data-driven tests

Here's a technique I sometimes use when I'm doing test-driven development (which is my preferred coding technique). Let's say I've got a bunch of test cases that are all basically the same, but they have slightly different inputs and slightly different outputs. A typical test case might look like this:

Continue reading "JUnit and data-driven tests" »

January 16, 2004

More on "More on getters and setters"

Allen Holub wrote an article in Javaworld recently entitled More on getters and setters. Oh boy, has this article caused some fuss in places.

Continue reading "More on "More on getters and setters"" »

January 17, 2004

Why IntelliJ is becoming more expensive

Saw an interesting post while cruising JavaBlogs. Weiqi Gao makes some interesting observations on what will happen to IntelliJ's IDEA product over the next few years.

Continue reading "Why IntelliJ is becoming more expensive" »

January 21, 2004

Examples for "More on getters and setters"

At the request of a reader, I've decided to post some examples on how something like the Employee class described in Allen Holub's article More on getters and setters could evolve. This may not be the only way, but it certainly is one way.

Continue reading "Examples for "More on getters and setters"" »

February 16, 2004

Aliasing problems and final member variables

I hit a really stupid problem today, and I've only got myself to blame (as usual).

The problem was really simple. I was making an object that needed to know when it was created. This creation date wasn't necessarily "now", so I was passing a Calendar object in to the constructor of the object to represent the creation date.

Continue reading "Aliasing problems and final member variables" »

February 19, 2004

A Weblogic "Kitchen Sink" episode

I encountered a lovely piece of Classpath Hell thanks to Weblogic (7.0) today. Or rather a colleague of mine did; I just helped him figure it out.

Continue reading "A Weblogic "Kitchen Sink" episode" »

March 13, 2004

Named parameters (aka Let's Join A Bandwagon)

I saw a post on Dion Almaer's blog on named parameters, and I thought I'd add my 2 cents worth.

Continue reading "Named parameters (aka Let's Join A Bandwagon)" »

March 17, 2004

Adding unit tests to a J2EE application

I got asked a very simple question today: how do you go about adding unit tests to an already existing J2EE app? In particular, so you can test your logic standalone, without needing to go through a deployment cycle and test it in the server?

Continue reading "Adding unit tests to a J2EE application" »

Eclipse Update servers

Jon Eaves of Thoughtworks was writing on managing Eclipse updates and how to preserve your environment between upgrades.

Continue reading "Eclipse Update servers" »

March 21, 2004

Fun with graphs - metrics for CruiseControl builds

Update: Woo-hoo... I got the second graph working the way I want. Check out the demo page linked below.

I've been playing with XPlanner recently, and I was impressed by the graphs that it could produce. So I knocked up something similar (using the same technology) for CruiseControl.

've been playing with XPlanner recently, and I was impressed by the graphs that it could produce. So I knocked up something similar (using the same technology) for CruiseControl.

You can find a snapshot of it at "http://www.users.on.net/robertdw/demo/demo.html" ... the data behind the two graphs is real, BTW (the reason there were so many broken builds at the start is because it was a brand new project, and the builds didn't pass until there was something to compile), so this isn't a fake in any way.

The two graphs I have got up are a pie chart showing proportion of good vs bad, and a time-chart showing number of good/bad builds each day. (What I want to do in the end is have the Y axis of the time chart be the time of day of the builds, so we see when builds of both types cluster, and how long they take to fix)

Obviously for the real thing, I would polish it up and place it in as another tab on the reporting web page. Once I've done playing (in a couple of days, maybe a week), I will be committing the result. However, I'd love feedback, and although I've sent a letter to the CruiseControl devel list, I thought I'd post this here as well to see what people think.

So... thoughts and feedback anyone? Suggestions? To quote Dr Crane: "I'm listening". Drop a comment in or send me a letter.

March 31, 2004

There are times that I really hate Internet Explorer

I'm working on putting some band-aid fixes into an application supplied to work by an outside vendor. For various reasons, I can't say who, which I really think is a shame, but...

Continue reading "There are times that I really hate Internet Explorer" »

April 4, 2004

I love the <import> task in Ant 1.6...

What can I say? I love the <import> task. :) If the Jolt Awards were accepting nominations at the moment, I'd be nominating that one bit of Ant 1.6 all by itself. :)

Continue reading "I love the <import> task in Ant 1.6..." »

April 14, 2004

An Amusing Thing Happened On The Way In Tonight...

In my role, I'm the defacto tools librarian; I'm the guy who sucks down the latest and greatest copies of everything so that other people don't have. Or more accurately, I'm the guy who sticks the files up on the intranet share so that other people can look there first...

Continue reading "An Amusing Thing Happened On The Way In Tonight..." »

April 16, 2004

More on stateless web apps

I thought I'd expand on my previous point. It's a simple one, but they're always the trickiest.

Web apps are by their nature stateless. Stateless applications are a pain in the butt to build, because they are extremely complex (not just complicated). By stateless, what I really mean is that the client state and the server states are disconnected. This is due to the (truly) stateless nature of the HTTP protocol that underlies all web apps.

Continue reading "More on stateless web apps" »

April 28, 2004

XDoclet 1.2 vs SGen

Update: I had a couple of simple mistakes in my presentation, which are now corrected.

I gave a talk at AJUG-QLD last night, on using XDoclet for code generation. Went down pretty well, I think, though that could be just my flattered ego talking.

Continue reading "XDoclet 1.2 vs SGen" »

JUnit Architecture Redux

Looks like I'm talking about another post of Cedric's. It seems he doesn't like JUnit's test suites, and decided to write a new tool to solve his problem.

Continue reading "JUnit Architecture Redux" »

May 17, 2004

Tools change the way you work

Vinny is worried that the use of IntelliJ IDEA has changed how he works, and he's worried about going to a project that won't let him use IDEA.

Continue reading "Tools change the way you work" »

June 8, 2004

Sun Developer Day Review

As I said earlier, I went to the Sun Developer Day in Sydney today. Overall, well worth the price of admission. Heck, I'd have paid double. ;)

Continue reading "Sun Developer Day Review" »

Annotation question answered

I've cleared up a question I didn't get answered at the Developer Day; the syntax for using annotations.

Continue reading "Annotation question answered" »

June 10, 2004

Another Sun Dev Day Review

Steve Mactaggart reviews the Melbourne Sun Developer Day. Looks like his thoughts were similar to mine

Continue reading "Another Sun Dev Day Review" »

June 16, 2004

Why some web frameworks don't distinguish between GET and POST

aniel Hinojosa asks What the hell ever happened to doGet() and doPost?

Continue reading "Why some web frameworks don't distinguish between GET and POST" »

June 18, 2004

Mixing <ant> and <subant> leads to confusion...

Update: It's not a bug, it's a feature! Seriously. ;) It turns out that the <ant> task effectively sets the basedir property as a user-property, which means that it can't be changed. User-properties are propogated through regardless of the inheritAll flag. The doco could have been clearer, but that's life.

The easy work around: don't use the dir attribute to locate the file, actually specify it in full (see the bug report for the example).

----

I lodged a bug report with Apache Ant today; first one in a long while. It turns out the the <ant> and <subant> tasks aren't entirely compatible.

Continue reading "Mixing <ant> and <subant> leads to confusion..." »

Remote Exceptions and the LSP

Why did I rabbit on about the Liskov Substitution Principle anyway? Because the infamous RemoteException is an example of the issue.

Continue reading "Remote Exceptions and the LSP" »

June 29, 2004

First impressions of Maven

I'm down with the 'flu today, so I thought I'd do something to take my mind off it and check out Maven. I've been somewhat critical of Maven in the past, but only tentatively as I've never really played with it. So I thought I'd rectify that.

Continue reading "First impressions of Maven" »

Don't you hate it when your expectations crash?

I just discovered that Checkstyle doesn't (yet) support Java 1.5. I found myself shocked by this for some reason; the Checkstyle project is such an active and evolving one that I just didn't think they wouldn't have put in some 1.5 support yet.

Continue reading "Don't you hate it when your expectations crash?" »

June 30, 2004

Controlling your log4j settings

Nick over at the System Mobile Web Log was having trouble with Log4J and his unit tests. Seems that he was getting the log4j.properties file from XDoclet, instead of the one he wanted.

Continue reading "Controlling your log4j settings" »

July 5, 2004

Does JUnit need annotations?

Filippo Diotalevi wrote about a wishlist for a better JUnit, and he mentioned Cedric's pet idea of using annotations to identify test cases.

Continue reading "Does JUnit need annotations?" »

It's not the ComboBox's fault

Weiqi Gao complains that combo boxes are lame because you can't type in them. He gives a good example of the state abbrevation MO for Missouri; in a typical drop-down list of US states, you need to go through seven M's to get there.

Continue reading "It's not the ComboBox's fault" »

What I don't like about TestNG

Seeing all the comments today about using annotations to declare test cases reminded me that I never got around to writing about what I didn't like about TestNG

Continue reading "What I don't like about TestNG" »

July 10, 2004

Annotations won't kill XDoclet

Euxx is worried that there will be stuff lost in the head-long plunge into annotations. Annotations won't be the death of XDoclet, nor for that matter will they be the death of deployment descriptions.

Continue reading "Annotations won't kill XDoclet" »

July 13, 2004

My vote for best architecture of the 20th century

It's simple, highly flexible, and extremely versatile.

Continue reading "My vote for best architecture of the 20th century" »

July 16, 2004

Creating a local Eclipse Update site

After having to work out how to do this again, I thought I'd give a step-by-step guide to creating an Eclipse Update site, populated by existing plugins. For this example, I'll create an update site for the Weblogic Eclipse plugin.

Continue reading "Creating a local Eclipse Update site" »

July 19, 2004

Ant 1.6.2 is out

Yep, Ant 1.6.2 has been released. And the forkmode option for JUnit is there!. I'm really happy.

Continue reading "Ant 1.6.2 is out" »

July 20, 2004

Ant 1.6.2 <junitreport> doesn't work on Java 1.4.1

Little warning for anyone else who stumbles across this problem: the stylesheet used for <junitreport> in Ant 1.6.2 does not work with Xalan 2.2. Unfortunately, this is the version that's bundled inside the rt.jar in Java 1.4.1.

Continue reading "Ant 1.6.2 <junitreport> doesn't work on Java 1.4.1" »

July 26, 2004

Beware of unlocalised JREs

This is a cautionary tale of US-only JREs and non-US countries, such as The Lucky Country I call home.

Continue reading "Beware of unlocalised JREs" »

August 14, 2004

Unit testing privates, and other unsavoury topics

Brian Duff gives a good example of a technique to get around visibility problems when unit testing. Believe it or not, this can be a good idea (and this is a strong TDD advocate saying this).

Continue reading "Unit testing privates, and other unsavoury topics" »

August 25, 2004

"Pass-the-parcel" exceptions.

Hani makes a surprisingly unbilish point about wrapped exceptions. Wrapping already wrapped exceptions isn't the best idea in the world.

This technique reminds me of the children's game of "Pass the Parcel", where you put multiple layers of wrapping on a gift, and the children never know when they will reach the last one.

I'm as guilty of this as the next person, but I think in future I will modify the constructors of my wrapping exceptions so that if a cause already exists, it uses that as the cause, not the one supplied...

(FWIW, I'm not against wrapping exceptions; what is an ObjectNotFound at one layer is a ConfigurationException at another, and should be reflected as such).

This may, of course, just be a stupid idea, but it's worth exploring.

August 26, 2004

Unit testing email

The JavaMail API is a nice, simple, and effective API. But it's got one problem: it's a bugger to unit test. This is mostly because (unlike most other Sun Java APIs) there are no real interfaces in place, which makes it hard to mock pieces out. An excellent solution to this problem is Dumbster.

Continue reading "Unit testing email" »

August 27, 2004

Singleton != Static

On Cedric's latest entry he complains about statics, and quite rightly. However, one of the commentators missed the point.

Continue reading "Singleton != Static" »

September 7, 2004

Roll-Your-Own IoC with Struts

IoC, aka dependency injection, is the current trend. The idea is simple: create your normal class, and rather than going and fetching things you might want (like datasources, factories, and so on), get them given to you instead. This greatly facilitates things like unit testing, because you've got a lot less dependencies to set up.

Struts uses Actions to drive an application. This describes a way to use dependency injection techniques with Struts.

Continue reading "Roll-Your-Own IoC with Struts" »

Roll-Your-Own IoC with Hibernate

It can be pretty useful to supply dependencies to domain objects that you're loading via Hibernate. This is where Hibernate Interceptors come into play.

Continue reading "Roll-Your-Own IoC with Hibernate" »

September 12, 2004

Follow-up on IoC with Struts

Don Brown made a very good point about a gotcha with the IoC technique I demonstrated with Struts: it's potentially not threadsafe.

Continue reading "Follow-up on IoC with Struts" »

September 20, 2004

Creational vs access patterns, and other diversions

A little while back, I blogged about how static and singleton are not synonymous, and one of the things I mentioned in there was the concept of an "access pattern". This is a term I've been kicking around for a while (in person, anyway... I think that was the first time I'd written about it), and I wanted to explore it a bit more here.

Continue reading "Creational vs access patterns, and other diversions" »

September 24, 2004

Gotcha with Struts/WebLogic and forwarding multi-part requests

Turns out that, with Struts 1.1. at least, this can be a bad thing to do. Why? You lose the parameters on the request.

Continue reading "Gotcha with Struts/WebLogic and forwarding multi-part requests" »

October 9, 2004

Getting