Profilo di BenNo Brain, No PainFotoBlogElenchiAltro Strumenti Guida

Blog


21 marzo

Software resuability

Ah, one of the holy grails of software development--building software components that can be reused by different projects, like bolts in a car or bricks in a house.  For as long as I can remember, people would always talk about how the "next big thing" (e.g. object-oriented in the late 80's or COM in the mid-90's) would finally allow us to create reusable components.
 
And for as long as I can remember, they've failed to make significant impacts on resuability.  Why?
 
As usual, I have some thoughts on this:
  1. The underlying software landscape is still changing rapidly--20 years ago you were most likely programming for text-based interfaces, then you started programming for 16-bit Windows, then 32-bit Windows, then browser apps, and so on.  Imagine that you had written some of the most fantasically designed and reusable UI components for DOS text-based applications.  How useful are they for Windows apps or web apps?  Not at all.

    The problem isn't that the original designer designed the compoents wrong; rather, the rules had changed and the solution that worked in the past is no longer relevant.  Imagine you took someone who has only built igloos all her life and told her to build a house out of wood and brick.  Many of the solutions she used while building igloos
  2. Things that look like they should be reusable often aren't.  My favorite example here are the oft-mentioned-but-never-quite-successfuly-implemented "shared business objects" that will be useable by all departments in a company.  Many times I've seen this attempted.  Depending how long you've been in the software industry, you might not be surprised when I say I've seen them fail an equal number of times.

    The main recurring problem I see here is that what's important about simple, central business concepts--an order, for example--varies wildly from department to department.  To a salesperson entering the order, it's all about the order lines, pricing and stock levels.  The shipping department is concerned about how many boxes will need to be packed, what size they are, how much they weight and where to ship them to.  Alternatively, the invoicing department couldn't care less about the shipping address.  The billing address, though, is of crucial importance.

    Yes, it's all one order, but its meaning massively changes while it moves through the process pipeline.

    The typical solution to this is to try to stuff everything that any department could possibly need to use into the object, making it huge, unwiedly and slow (oh! oh!  sounds like you're gonna start needing to use lazy load).  The problems, though, are just beginning: you implement a DeleteOrderLine() method, and it works great for sales reps who need to delete an order line during the order entry process when the customer says, "oh, wait, nix those three printer cables I just mentioned."

    All fine and good, but how will DeleteOrderLine() work when the package is returned by the shipping company and the warehouse has to delete the order line--because it turns out shipments to a certain foreign country are limited to 40" long since the last leg of the journey is flown in a Cessna and the package won't fit in the airplane?  I encountered this at my last job.  For this case, DeleteOrderLine() would have to refund the customer (since they had been invoiced already), and probably notify someone to send an apologetic email, and so on.

    Or how about an order line for a backordered part that, after serveral weeks, you realize has been discontinued?  This time you don't have to refund the customer (since he hasn't been invoiced), you'll have to notify the sales rep that they need to contact the customer and explain the situation (and options).  And we're just looking at a couple of scenarios for one method.

Am I arguing, then, that software reuse is impossible?  Absolutely not!!!  Certain pieces of software has achieved remarkable reusability, things like the C runtime library and the Java and .Net runtime libraries.  I've been using functions like sprintf() for 20 years now, in DOS, in Windows, UNIX, and back-end processes.  I'm pretty positive I'll be using it for at least a decade more; that's exceptional reuse in my book.

And that's the key to writing reusable software--keeping functionality very concise, and only targetting things that have reasonably broad appeal across many types of programs--some of the examples I've seen implemented successfully and reused often are date conversions between systems, logging functionality, and exception handling management.

Fortunately for us, though, much of the functionality like this has already been implemented in things like the .Net Framework runtime and the Microsoft Enterprise Library.  That means that there's not a ton of stuff out there that's reusable but hasn't been implemented already, so there's not a lot of new opportunities for us to write reusable code.  But that's good thing, since it means we immediately start reusing this code without having to write it in the first place.

Ben

14 marzo

Volkswagen of America loses another customer

Actually, for a while now I doubted I'd ever buy another VW product, but today just sealed it.
 
Last month was the 9th time I had to bring the car in for non-scheduled repair.  Not quite lemon-law numbers, but far more than I'd expect for a modern car (basically, every 5 months or so I'd have to bring it in for something not working correctly, mostly MIL (aka check engine) light on).  What bugged me about the last time I had to bring it in for an ignition coil failure--which immediately brought back memories of when I was buying the car, and telling the salesman that I was concerned about ignition coils and windows falling into the doors, which were a huge issue for VW back then (early 2003).
 
He assured me everything had been resolved.  If you look at my service history, though, you'll see the car has been in the shop for 1) a broken driver-side window and 2) a failed ignition coil.  Haha!  <-- that's me laughing at myself for being such a sucker :-p
 
The ignition coil failure, though, piqued my interest some.  My car had been built in August 2002, which (as far as I can tell) was right around the time that the new and improved (read: reliable) coils started getting installed into vehicles.  I figured that with all the bad press VW was getting at the time I bought my car, certainly they wouldn't be selling more cars with the old, unreliable parts... or would they?
 
Well, last weekend I replaced the spark plugs in my Jetta which requires pulling the coils out to get to the spark plugs.  And lo and behold, stamped on the three coils that hadn't been replaced was "06B 905 115H"--the old, defective part number.
 
My question then was, why wasn't my car recalled if it has the defective part number?  So, I put that question to VWoA Customer Care, who basically said, "sir, your vehicle wasn't identified as part of the recall".
 
I know, that's why I'm asking!!  It has the bad parts, why wasn't it recalled?
 
"Sir, your vehicle wasn't identified as part of the recall".
 
The part that *really* drives me nuts is that the coils are realtively cheap--around $30 a piece, at least through the internet.  So, for a couple hundred bucks, they could have just replaced my coils and made me think, "well, the car hasn't had great reliability, but at least they're trying to resolve it."  Instead, they persuaded me to write this post :D  And, in the grand scheme of things, it'll only cost me about $100 to replace the remaining coils.  As for my new, more complete understanding of VW--that's priceless.
 
VW hasn't been doing great in America, and while I may not have an MBA, I think I may have a valuable suggestion for them:
 
MAKE YOUR CARS MORE RELIABLE AND SHOW SOME COMPASSION FOR YOUR EXISTING CUSTOMERS.
 
Frickin' rocket science.
 
Ben