Saturday, December 15, 2007

JEE 5 Development with NetBeans 6 First Impressions

Playing around with Netbeans 6 for writing my trivia software for a couple hours now, and I must say, even with the great tool support this JEE 5 stuff is a relatively slow development process. Particularly frustrating is that it doesn't appear that Netbeans is terribly good at auto-generating a JUnit test that can access the JEE context. I got relatively spoiled with RoR with my last trivia re-write, so I really expect unit testing to be a first-class consideration for any programming environment. If the environment makes it difficult to unit test, then it makes it difficult to develop, end of story. I'm certain that it's possible to get my unit tests set up to actually run, but as a JEE newbie, I'm not sure exactly how to go about it, and I feel time spent figuring out how to make a JEE context available to JUnit is time that's pretty wasted. I'm attempting to add a JSF page for displaying some of my entities, but even that is relatively painful. While the Scaffolding that Rails provides is rarely used in the final deployment of an app, it is very nice to have that structure there from the get-go so that you can hit the ground running. I'm finding in NetBeans that I'm having to build up that scaffolding myself (though it's possible that I just missed some wizard for generating a default interface for managing your entity beans). When I create a Visual JSF page in NetBeans, it creates a ton of (IMO) useless junk in the resulting classes. Also, what's with the ugly SessionBean1, RequestBean1, etc. I see the purpose for the classes, but are they really manditory? If not, why have them created by default? Finally, it was relatively irritating using NetBeans Bind to Data functionality for binding some data to a JSF table. I tried a few times to expose a List<Weekend> (a weekend is the top level entity in my trivia software) and bind the table to that, but it wouldn't appear in the magic Get Data From drop down. Apparently, I have to expose the property as an array (Weekend[]) rather than a generic List. I'm certain that it's possible to code around these issues that I have, but from a first-impression stand-point, NetBeans and JEE 5 aren't really impressing me that much. I do feel that JPA is a vast improvement over EJB 2.1persistence, but I'm really not sold on JSF (I may just go back to straight JSP/Spring MVC for this project) or NetBeans default JEE wizards. Also, the emacs keybindings for NetBeans are atrocious. Ctrl-G should stop the previous incremental search (and turn off highlighting of the results), not bring up a go to line dialog. It doesn't appear that Ctrl-Alt-f and co aren't working. Emacs bindings are more than just Ctrl-a, Ctrl-e, Ctrl-p, Ctrl-n, people. It doesn't appear that there's any notion of a mark, nor a kill ring. Eclipse at least does a very adequate job of emulating these features (though I still run into surprises when using Eclipse). Anyway, that's enough brain dumping for today. Perhaps once I get this initial scaffolding in place for my project I'll start to see some productivity improvements. Also, I've always felt that one of the strongest arguments for using Java over scripting languages is the superior support for debugging and observability, not initial developer productivity.

No comments: