Thursday, February 7, 2008

Java Plugins

I learned something pretty neat today. The team at my office is working on a medium-sized Java project and we have the need (desire really) to develop some components as plugins. One of the guys came across some example code to do just that (thanks to the folks at javaranch.com). After seeing the example we realized that Java has a handy utility built right in that handles plugins nicely. The ClassLoader class (sorry, I forgot the namespace and don't have a reference handy) makes quick work of plugins. And check out his friend UrlClassLoader to load code from any standard URL style resource. Stuff like this is why I like Java. I have developed plugins before in C++ and Linux. It was not this easy. So go ahead and make your code plugable. It's easy!

No comments: