Skip to content

Hot off the press: Apache CXF Web Service Development

My reward for blogging about CXF? I get to review the recent book Apache CXF Web Service Development by Naveen Balani and Rajeev Hathi. Looking forward to receiving my free review copy. (Are presses hot these days?)

Tagged , , , ,

In defense of elite, irrelevant curricula

I’m a big fan of Joel Spolsky’s writing, but I take issue with his latest posting. Universities shouldn’t be focused on teaching students the technologies and practices of the day. Anything you can learn by leafing through Getting Things Done, Agile Software Development with Scrum, and Expert One-on-One J2EE Development without EJB does not belong in a university curriculum. Rather, they should be teaching elite, irrelevant subjects like language, history, philosophy, math, math, and more math. (Although what takes the wind out of my sails is that the perfect rebuttal has already been written by Joel Spolsky himself.)
Continue reading ›

Tagged , , ,

Best practice for branching and merging? Depends on your SCM.

I ran across a nice blog entry discussing the different use case assumptions made by Perforce vs ClearCase regarding when developers will branch and merge. After using Perforce for the last two years and reading Laura Wingerd’s excellent book Practical Perforce, I’m heavily biased to the point of view that routine development should happen on the trunk, and branches should be created only to fix bugs in old releases or to develop experimental new features that might not get merged back into the trunk.

But I also believe in the “when in Rome” principle. As developers, we should try to conform to the spirit and assumptions behind the tools we are using (e.g. nobody will thank you for using Lisp idioms in Java). So if we have to use ClearCase, and the Atria / Rational / IBM people expect us to develop on private branches, maybe we should. Opinions?

Tagged , , , ,

Serializable != Synchronized, especially not with Oracle

Recently I wrote some database code and tried to convince myself that it was threadsafe. I realized I’d made a basic mistake about the serializable isolation level, and thought it was worth a quick blog entry to post the explanation, in case anyone else runs into this situation. The problem can be represented by this simplified example:

Transaction Example

Transaction Example

Both transactions are trying to process withdrawals of $100. In either case, if the balance is sufficient, a status message is sent to a downstream system and the balance is reduced. Otherwise the transaction is aborted. If these transactions are run in the serializable isolation level, can they be executed concurrently without fear of overdrawing the account, sending the status message more than once, or creating any other problems? Actually, no.

Continue reading ›

Tagged , , ,

Excedrin headache #3.5.40128.1: Using combo boxes with the WPF DataGrid

If you’re working with the WPF DataGrid (January 2009 release, version 3.5.40128.1) and want to display a column of combo boxes (e.g. to select a value from a list of options) you may be in for a headache, especially if you want the available options to be supplied from the binding context. For example say you are displaying an editable table of orders, and each order is for a particular quantity of a particular product, and the products are selectable using combo boxes.

Here is a solution, the main element of which came from a posting on the Codeplex web site from someone called XIU for which I’m grateful. I thought I would add some more detail in case anyone else has this problem and wants a more cut and pasty solution.
Continue reading ›

Tagged , ,

Is reflection unhealthy?

Am I the only one who feels a bit dirty after writing code that uses reflection? Most programmers agree that strong typing is a good feature in programming languages, because it allows compilers to catch many kinds of programming errors before you run your program the first time.  But using reflection completely bypasses that security.
Continue reading ›

Tagged , ,

Java template for WSDL-first web services using CXF (for Maven2 and Eclipse)

This took me a while to put together so I thought I’d post it. I wanted the simplest possible template for building a web service in Java. I wanted it to be JAX-WS compliant, so I used the CXF open source implementation which is not only compliant, but also flexible and fast. I also wanted the template to be WSDL first, meaning that I should be able to edit the WSDL by hand to maintain total control over the service contract, then from that, generate Java code to make it easy to fill in the implementation.  (I consider that to be an important part of web service best practices. Doing it the other way – automatically generating WSDL from code – is simpler, but results in messy, sometimes incorrect WSDL that limits your ability to change web service implementations later.) Furthermore, I didn’t want to edit any generated code. I wanted to be able to fill in the implementation details by inheriting from a generated class or implementing a generated interface. Finally, I wanted to take advantage of Maven to build the project, but also be able to work on it in Eclipse, taking advantage of its Web Tools Platform (WTP) to allow synchronization with a live application server. Here’s the result in just under 300 lines of code. (Or you can cut to the chase and just download the zip file and follow the instructions at the end of this posting.)
Continue reading ›

Tagged , , , ,

A maze of twisty little Java web service standards, all alike

It’s almost impossible to keep up with all the fractal-like Java standards related to web services. As fast as each can be learned, Sun invents another, and a dozen open source implementations appear. For my own sanity I tried to create a rough map of some of them. I tried to avoid making recommendations; my main objective was to sketch out how they fit together. I also focused on the open source options; there are many good commercial implementations of all of these too.
Continue reading ›

Tagged , ,

Is Eclipse collapsing under its own weight?

Maybe Eclipse’s black-hole-like splash screen is more appropriate than its designers realize. Eclipse’s open architecture has enabled the creation of countless useful plugins, and that’s helped maintain its position as the leading Java IDE. But as plugins compound upon plugins, bugs and compatibility issues have been surfacing increasingly frequently, and I’m starting to get the sense the Eclipse developers have lost control.
Continue reading ›

Tomato: An antioxidant for your router

Every few months my Linksys WRT54G V4 home wireless router stops working and nothing short of a full reset gets it going again. This weekend it happened again. I got fed up and started Googling. I found out I’m not the only one to suffer from this problem. But then I found out that in 2003 Linksys, under pressure to comply with the GPL, released the router firmware and immediately afterward people started coming out of the woodwork improving it. (Doesn’t anyone have better things to do with their time?) Seriously, this has to be one of the best open source success stories ever. Some open-source variations of the firmware provide more features, giving this $60 router functionality similar to a $600 router. Others allow you to boost the RF signal. Still others provide a simplified and improved user interface. Most allow SSH or Telnet access to the router’s Linux kernel. All of them reportedly improve its reliability. I researched several of these and tried DD-WRT for a few hours. It’s very powerful and I was almost sold, but then I discovered Tomato. It’s perfect and I’m never going back.
Continue reading ›

Tagged , , ,