Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Impact of NIO wrt J2EE projects

 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
     
    Greenhorn
    Posts: 12
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Author
    Posts: 30
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Pho Tek
    Ranch Hand
    Posts: 782
    Python Chrome Ubuntu
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Ron Hitchens wrote:


    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
     
    Lasse Koskela
    author
    Posts: 11962
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Ron Hitchens
    Author
    Posts: 30
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic