Author Archive

Hot off the press: Apache CXF Web Service Development

February 24th, 2010 / Joe on Computing

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?)

In defense of elite, irrelevant curricula

November 1st, 2009 / Joe on Computing

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.)

I don’t disagree with the argument that students ought to learn time management and teamwork, and I don’t recall universities doing a particularly good job of teaching those. (It’s been a long time since I’ve attended university, but since they are apparently trapped in the 1980s, my personal experience and memories of my time there are still relevant.) And maybe they don’t teach students about version control, estimating, and many other aspects of being a productive software developer. But here’s why I disagree with Joel’s premise:

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

August 30th, 2009 / Joe on Computing

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.

Serializable != Synchronized, especially not with Oracle

July 18th, 2009 / Joe on Computing

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.

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

February 17th, 2009 / Joe on Computing

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.

Is reflection unhealthy?

January 28th, 2009 / Joe on Computing

Am I the only one who feels a bit dirty after writing code that uses reflection? Most people 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.

Reflection is useful for working around the type system when it gets in the way. For example say you want to write a universal object serializer. It needs to work on classes that haven’t even been defined yet, so there’s no way it can access the instance variables of those classes in a type-safe manner. Reflection provides a way to ask objects what instance variables they contain, the current values of those instance variables, and so on. There are countless applications – I don’t need to list them here. (There’s a good discussion on the Fog Creek discussion board.) But what’s interesting is how reflection subverts strong typing.

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

October 23rd, 2008 / Joe on Computing

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.)

First, here is the trade.xsd schema file containing the input and output datatypes used by the web services:

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

October 22nd, 2008 / Joe on Computing

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’ll try to avoid making recommendations; my main objective is to sketch out how they fit together.

First, it’s important to understand that there are three main players with implementations of of these standards: Sun, the Apache foundation, and Codehaus. There are many other open source implementations as well, but these are the three 800 pound gorillas, for a total of 2400 pounds, or almost exactly one metric tonne (for our international audience).

Is Eclipse collapsing under its own weight?

October 20th, 2008 / Joe on Computing

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.

I spent considerable time downloading Ganymede today for only one reason: I wanted to try the new JAX-WS WSDL First project wizard. It would be hard to come up with a geekier, more obscure name than that, but in essence the feature promised to allow me to create a web service with the click of a button, following various best practices. With great anticipation (okay, I’m exaggerating; with vague hopefulness) I downloaded Ganymede, and decided to try the wizard with the CXF web service library. Here’s the error I got:

Tomato: An antioxidant for your router

October 6th, 2008 / Joe on Computing

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.

From the Tomato home page: “Tomato is a small, lean and simple replacement firmware for Linksys’ WRT54G/GL/GS, Buffalo WHR-G54S/WHR-HP-G54 and other Broadcom-based routers. It features a new easy to use GUI, a new bandwidth usage monitor, more advanced QOS and access restrictions, enables new wireless features such as WDS and wireless client modes, raises the limits on maximum connections for P2P, allows you to run your custom scripts or telnet/ssh in and do all sorts of things like re-program the SES/AOSS button, adds wireless site survey to see your wifi neighbors, and more.”

Orange lines

August 2nd, 2008 / Joe on Computing

A few evenings ago I looked out of my kitchen window and saw an airplane’s vapor trail in the sunset – a beautiful, bright, clean, orange line cutting through the clouds. At that moment I had brief but unmistakable feeling of optimism about the human race.

For one thing, jet airplanes are a marvel of engineering. Hundreds of thousands of people collaborated to create them, maybe even millions if you include the scientists who worked out the principles of flight and jet propulsion, the inventors and engineers who applied those principles, the entrepreneurs who created an airline industry, and the pilots, air traffic controllers, technicians, and support staff who keep it all running. Think of everything that goes into an aircraft and try to count the number of people involved. Don’t forget the avionics, the bathrooms, and the in-flight entertainment system. (Maybe leave out the food, and definitely leave out the homeland security people.)

Slimmer, trimmer messaging from Google

July 15th, 2008 / Joe on Computing

Google’s Protocol Buffers offer lightweight, language-independent object serialization. I love the design, especially as I’m increasingly seeing enterprise networks clogged with hordes of oversized XML messages. Protocol buffer bindings are available for C++, Java, and Python, but not C# yet. Once there is support for .NET, I think this could be a really interesting technology for financial applications.

Developing Web applications with Maven and Eclipse: You *can* have it all

June 1st, 2008 / Joe on Computing

When developing applications using Eclipse or a similar IDE, you quickly get used to being able to test your software immediately after making a change. Plugins like MyEclipseIDE enable that kind of instant edit/compile/test cycle for web applications as well.

But if you’re building web applications with Maven, it’s not so easy. Maven is a fantastic tool for building applications and managing dependencies, but it lends itself to a more batch-oriented mode of operation in which you build and deploy war files from the command line. I found myself wishing I could have the best of both worlds; building my web applications using Maven, but with a seamless edit/compile/test cycle when using Eclipse. Then I discovered the WTP (Web Tools Platform) project. Hallelujah!
(more…)

A virtuous pairing

April 16th, 2008 / Joe on Computing

I ran across the following comments on an El Reg article about virtualization: Comments about “Virtualization: Nothing New”.

He’s right, isn’t he? Having the same company offer both virtualization and grid solutions is a truly virtuous pairing. First you tell people they need a grid solution to make a huge pool of computers look like a single one, then after it’s all set up you sell them virtualization software. It’s beautiful. It’s like if, for example, Nestle and Jenny Craig got together to simultaneously offer chocolate products and dieting solutions. Oh wait, they did: Nestle to buy Jenny Craig.
(more…)

My new favorite ISP

March 13th, 2008 / Joe on Computing

My new favorite web hosting provider is A Small Orange. Their pricing is competitive, and their tech support is unbelievably quick and clueful.

The US airline industry and the prisoner’s dilemma

December 30th, 2007 / Joe on Computing

The US airline industry is a national embarrassment. I’m writing from Tampa, Florida where I just spent the night because of a flight delay which caused me to miss the last connecting flight of the day. I’ve flown about a dozen times in the last two years, and I can’t remember a single domestic flight that got me to my destination on time. The delays are always due to “weather” which means the airline has no obligation to compensate the passengers. How’s this for an idea? Any time a passenger is delayed more than four hours arriving at their ultimate destination when the entire trip is booked through a single airline, the passenger is entitled to a refund of 40% of the price of the flight, with an additional 10% penalty for every hour beyond that. If the flight is more than 10 hours late, the flight is free.
(more…)

The network is the network, the computer is the computer – sorry about the confusion

September 30th, 2007 / Joe on Computing

This post continues my ongoing theme: That networks are great as long as software doesn’t pretend they are perfect. (I can’t take credit for the title – it’s been floating around for a long time.)

Increasingly, software is being designed based on the idea of treating network resources as local. The practice of generating proxy objects to invoke remote services increases the tendency to think this way, as does the success of HTTP based remote invocation patterns like REST, SOAP, etc. (It’s tempting to think of HTTP services like function calls: Send request with parameters, wait until results come back, proceed.)

Ten meta-requirements for enterprise software development

September 3rd, 2007 / Joe on Computing

When you start a project to build a custom application for an enterprise customer, there are always universal requirements the customer doesn’t tell you about. These are things you have to do in order to implement the stated requirements, so I call them meta-requirements.

It’s helpful to keep a checklist of these and review them at the beginning of any new project, especially if the project is in an unfamiliar IT environment. Here’s my checklist of ten.

(more…)

Protecting your SOA application (and your job) from remote failures

August 26th, 2007 / Joe on Computing

SOA – for Service Oriented Architecture - is the buzzword du jour. Organizations in all industries want to realize its promises, which include sharing information more openly and coherently across the enterprise and increasing organizational agility by making it easier to assemble new applications from existing components. Although there are fierce debates about the details (SOAP vs REST, contract first vs schema first vs code first, etc.) there is little disagreement about the general principles. Software should be constructed in the form of loosely coupled, coarse-grained, stateless services which can be invoked remotely over a network, and which form the basis of enterprise code reuse. This is a huge topic about which volumes have been written, but for now I’m going to focus on one issue: The importance of designing your SOA services to be resilient against network failures.
(more…)

Welcome to Joe on Computing

August 26th, 2007 / Joe on Computing

Welcome to Joe on Computing, the new home for my blog. Although it will have many omissions and contain much that is apocryphal, or at least wildly inaccurate – it has the advantage of matching the garish color scheme on my home page that I have come to love, which I call “retro Frogger”. Enjoy. Comment. I love a good argument.