Hi there, I've been wondering whether the NIO will affect the way J2EE applications are built in any way. Opinions/views on this? A common response has so far been something like "you don't have to think about it, the appserver will handle those things"... But as I believe that generally it's important to know what's happening under the hood, I believe that this is true for NIO as well. I would be interested to hear war stories about "the quirks of NIO" - things I wouldn't normally think of and thus get me in trouble. br, Lasse
Lasse, Here's what I found regarding the effects of NIO on J2EE projects:
Backward Compatibility issues - An issue will arise about the adoption of j2se 1.4 as most frameworks still need to be backward compatible with older releases. I guess the j2se 1.3 is as far as most products would target for.
Tomcat and NIO - As this post says; the Tomcat container already uses some NIO-like features (hidden from the developer)
On a practical note, have a look at this weblog post regarding the use NIO to improve the performance of uploads of huge files to a Struts 1.1 application. Cheers, Pho
I'd be interested in knowing this as well. I'm in the middle of a relatively huge project involving the 1.3 version of the SDK and an Oracle application server. There are tentative plans to go to 1.4 at some point, though, and I want to know if there's anything that's going to hold us down and make us give it our lunch money.
It's always been my opinion that NIO's greatest impact will be mostly unseen. It's the app servers and similar high-end products that will use NIO under the hood to improve scalability and performance. In a J2EE environment, most of the stuff that NIO is useful for is handled by the container. Servlets and EJBs may still make use of some NIO features but doing so in the near term restricts deployment choices. If I can drop my generic EAR into the latest version of JLogicSphere and automatically get a boost from its use of NIO then I win even though I don't use NIO directly.
It's always been my opinion that NIO's greatest impact will be mostly unseen.
Does that mean J2EE developers who will not be dealing with the innards of appservers, LDAP servers, java databases, JMS, SOAP messaging etc... can safely skip learning about NIO (since java.io.* works) ? Cheers, Pho
So, the general opinion seems to be that I, as a J2EE developer, won't benefit much from learning NIO. Would I be wrong in saying that it's more beneficial to learn how a particular appserver has implemented certain parts affecting performance (and thus, possibly the architecture) without paying much attention to the actual implementation of NIO concepts.
Well, as the author of an NIO book, I don't want to discourage anyone from learning more about NIO. But I'm also a pragmatist. If you're primarily writing webapps which run inside a container then your primary focus is going to be on interfacing to the container and leveraging the services it provides. That doesn't mean NIO has no interest for you, but in such an environment NIO is probably most profitably applied to improving the container rather than the contained apps. Although you could certainly find uses for the file-related aspects of NIO, for example. I see NIO as similar to Reflection or Weak References: important building blocks of the Java environment and something every professional Java programmer should be familiar with. But not something that most will use on a daily basis. At least not in all application arenas.