Skip to main content

Examining Premises: why use a framework?

Posted by richunger on April 9, 2005 at 10:37 AM PDT

In working on my JavaONE presentation, I got to thinking about why frameworks such as the NetBeans Platform and Eclipse RCP are important. It's really because, if they didn't exist, we'd all end up rewriting them, anyway.

Every project I've ever worked on started out as a dedicated application, with a very simple architecture. Then, as features are added, and they don't fit nicely into what I already have, I have two choices:

1. I can do some rewriting, and just "get it working" in time for the release date. This results in buggy, hard to test code.

2. I can begin to modularize what I have, and create a pseudo-framework that can accept new components more easily without breaking what I already have.

The idea with these platforms is to start with the framework, and build out. Of course, the challenge there is to make the learning curve shallow enough that folks making initial versions of their dedicated applications won't blink at starting with them. When I first picked up netbeans (several years ago), the learning curve had Everest-like proportions. It's gotten a lot better, but I still have a few annoyances.

I think the declarative method for laying out components is very difficult to grok, and far too easy to break, especially when trying to create a singleton TopComponent. I've gotten very little traction from netbeans developers whenever I bring that up. After all, they just rewrote the darn thing.

The new projects system is a joy to work with on an API level, though. It's super easy for me to create my own flavor of project. Also, the way the Lookup mechanism works to provide context as the focus moves around to different components has a certain zen to it. It "just works".

And the new UI and tools for modules developers, which is slated for version 4.2 should go a long way towards lowering the barrier to entry.

The J2EE side of the aisle is way ahead of the desktop space when it comes to recognizing the value of a prebuilt framework. Web developers everywhere were building their own dialog management components, until Struts came along and gained a serious following.

Of course, the J2EE crowd went overboard. They're framework-happy! And, boy, am I confused. More on that in the next entry.

Related Topics >>