I like your interest in pluggable implementations. One way to approach ugly code is to move it into another class and forget about it.
Seriously, you can move object creation to some kind of creational helper (avoiding the
word Factory which has a specific meaning that I don't want to get into).
That isolates your logic from any creation issues, such as exceptions. You don't have to know if the Vendor (it's hard to make up new words that don't already have meaning here) uses Class.forName() or looks up the classname by a logical key, makes new instances every time or gives you existing instances from a pool.
I'd look to break your program up a bit, move main() to a new class that sets up some configuration, like which subclass to use. We could maybe make that Vendor fit the Factory Method
pattern.
Any of that sound useful?
[ May 16, 2007: Message edited by: Stan James ]