Open Source Libraries: What Not to Do

How hard can it be to use an Open Source java library in your project? I mean, all you need to do is drag the JAR on to your CLASSPATH and your done. Oh right, yeah, fine. You need the dependencies too. And the dependencies of any dependencies. And so on.

But I mean, it's not hard is it?

Certainly not to start with. But then there's a new version of the library that you could use. And it deletes an API you use. Or you're not sure whether it'll work properly. Or it's a bad day to upgrade the entire codebase. Or you have no idea whether something will work or not. So what do you do? What do you do?

Don't do this: have a second copy of the library in your source tree. That's dumb. That's dumb because you're depending on classpath ordering, which may or may not happen consistently.

Which means that you need to have only one copy in your source tree at any one time. This also means that if you need the latest and greatest feature from a library, you're effectively becoming something like the Apache Gump, and sometimes something's not going to play well with something else. That's when it gets fun. That's what I'll cover tomorrow....


Simon Stewart on Wednesday, 28 January, 2009

Posted in: /tech

You may comment...


Categories