Non-standard usage model

You’re the chief technologist of Webz R Us. You’ve been around, used a few different languages. You think in the abstract and can adapt to the specific implementation. You can make ColdFusion sing and dance. Now you’ve given yourself the task of getting Spring and Hibernate up and running with your ColdFusion web apps. You’re not using CF9 ORM – you’re going to roll your own for ultimate control.

It’s natural to think that you can take your accumulated wisdom and cherished practices and tweak them a bit for this new implementation technology. If you’re a JEE web app developer, that might be true. If you’re a ColdFusion developer, it almost certainly is not.

So after a train-wreck or two, you jump onto the forums – this is open-source software with a vibrant community, right? – and explain your cherished practices, why they’re so great, and ask for help on that one little API that you need to make everything fall into place. It’s so obvious to you that this should work. You’ve been doing it for years in ColdFusion. In Java, with all these great frameworks, your cool approach should be even better supported and easier to do.

And what you’re told is:

That’s a non-standard usage model

Let me translate that for you:

  • What a dumb idea
  • Even if it works, nobody cares
  • Go read the documentation
  • You n00b

OK, I’m being a bit harsh here. Let me try another translation:

  • 99% of successful projects don’t use your technique
  • Maybe you should think about why that is so
  • You really do have an edge case? Time to man up and earn those big bucks. Good luck.

I love the quote below. The guy who wrote this really had put in the hard yards to understand the questioner’s use case – this was by no means a brush-off:

How about you just trust what Hibernate is doing, because it always has very good reasons for its very sophisticated caching behavior, and the people who designed this stuff have spent a lot, lot more time thinking about caching and transactions than you have.

I didn’t post this just to be amusing. I’ll be referring to this post a lot in the coming months. You won’t believe how many non-standard usages I’ve been able to come up with. Stay tuned…

cfobjective(ANZ) demo code

I’ve made the demo code from my cfobjective presentation available here:

There are two folders in the zip. One is the eclipse project, the other is the eclipse workspace. You should just be able to import the project into your own workspace, but just in case I’ve given you the workspace I used.

If you just want to look at the code, read no further. If you want to run stuff, you’ll need to tweak some things, and there are some caveats. I made these assumptions:

  • the project is at /home/owner/cfobjective/springhibcfdemo
  • the coldfusion install is at /home/owner/coldfusion8
  • it’s a standard ColdFusion 8 install, NOT multiserver
  • you’re running the built-in webserver – not critical, if not you’ll have to set up your own virtual directories

If you search the project for “/home/owner” you’ll find everything that might need to be changed.

Now the caveat:


Don’t be afraid – just don’t run the build script if you’re not cool with that. I’d recommend you run up a throwaway ColdFusion dev install and point the build script at that.

The build script will create virtual directories for the JRun webserver. Have a look at jrun-web.xml for details.

That’s about it. You don’t need a database, all the necessary jar files are included, and the CF built-in webserver should be OK for these purposes.