Download NetBeans!

20060112 Thursday January 12, 2006

To be or not to be... J2EE

Let's say you're a web developer but you have no interest in J2EE. You also have a slow computer. So you disable the J2EE module, which is something you can do because the IDE is modular. Suddenly everything speeds up and the world is wonderful again. However...

  1. You run into a problem with your JSP page, and you think: "Hmmm. I wonder what the helpfiles says about this." Then you look in the helpfiles and discover... there's nothing in the helpfiles about JSP files! There's nothing in there about servlets! There's nothing about building or deploying your web application! Why? Simple: The helpfiles that relate to web applications are all in the J2EE module.

  2. You think to yourself: "Hmmm. I've got a cool web application. Let's add some web services." You go to the New File wizard and you find... no web services! Why? Simple: Web services are part of the J2EE module, and when you disabled the J2EE module you also disabled web services.

  3. You read the J2EE specification and you find that the J2EE specification covers far more than just EJB and web services—it also deals with JSP files and servlets. Then you look in the Module manager and you see there's a module called "J2EE" and a module called "Web". You think to yourself: "What's going on here?" This doesn't seem to comply with the specification at all. Why? Simple: NetBeans IDE considers "J2EE" to mean functionality that pertains to application servers, EJBs, and web services. But, this is wrong. (In fact, the first sentence of this blog entry is wrong—if you are a web developer, you must be interested in J2EE, because web development is part of J2EE.)

Worse, the first two of the above things happened to me while demonstrating things in Egypt. Firstly, my flatmate Lou Ruppert was in the first scenario—he has a very slow laptop, which is okay when he's doing his daily web development, via Tomcat. He hasn't used EJBs and web services and has no need to do so, so we disabled the J2EE module. But he wanted to upgrade an old web.xml file from 2.3 to 2.4. I said: "Look in the helpfiles, because I wrote a help topic which describes exactly how you do that." When he looked in the helpfiles, he found nothing. Only after I remembered that it was part of the J2EE module did I realize the cause of our being unable to find the help topic. Secondly, while demonstrating new 5.0 functionality to the AUC students in Cairo, I wanted to show them how a J2SE application can consume web services in 5.0. Again, the J2EE module had been disabled, and only after realizing that was it possible to continue with the demonstration. (If they had disabled a module called "web services", they would probably have been more aware of what functionality they had excluded, rather than something as amorphous as "J2EE".)

The third point above is something that NetBeans Evangelist Gregg Sporar pointed out to me—JSPs and servlets belong to J2EE. Whatever the case, though, I think it would be helpful to split the J2EE module into (at least) three—"EJB", "web services", and "application servers". I'm guessing there's some technical reason for why this hasn't been done already, but I'm hoping that this is possible somehow. Because, the current status is not very satisfactory—the term "J2EE" is just not transparent enough.

Jan 12 2006, 01:26:41 AM PST Permalink