<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Critique of Java NIO frameworks</title>
	<atom:link href="http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/feed/" rel="self" type="application/rss+xml" />
	<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/</link>
	<description>software development and computer gaming</description>
	<lastBuildDate>Tue, 27 Oct 2009 02:56:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Christoffer Lernö</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-405</link>
		<dc:creator>Christoffer Lernö</dc:creator>
		<pubDate>Tue, 10 Mar 2009 19:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-405</guid>
		<description>I harbour a deep dislike for java frameworks. They tend to be bloated things that force you to make your app into a plugin for the framework. 
I wrote a NIO *library* (rather than framework) where I tried to make working with NIO as easy, or even easier than with normal IO.
I&#039;m interested in knowing if you feel it suffers from the same drawbacks as the frameworks you mention. The project is called Naga and can be found at naga.googlecode.com.</description>
		<content:encoded><![CDATA[<p>I harbour a deep dislike for java frameworks. They tend to be bloated things that force you to make your app into a plugin for the framework.<br />
I wrote a NIO *library* (rather than framework) where I tried to make working with NIO as easy, or even easier than with normal IO.<br />
I&#8217;m interested in knowing if you feel it suffers from the same drawbacks as the frameworks you mention. The project is called Naga and can be found at naga.googlecode.com.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Penev</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-395</link>
		<dc:creator>Ivan Penev</dc:creator>
		<pubDate>Thu, 19 Feb 2009 17:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-395</guid>
		<description>I have always been on the same opinion with kmatveev. So finally I decided 3 years ago to make my own simple, scalable framework. It could sound as a advertisement, but if you look here &lt;a href=&quot;http://javawork.org&quot; rel=&quot;nofollow&quot;&gt;javawork.org&lt;/a&gt; you will find in the examples that it is really easy.

Apache MINA has always been the preferred choice by many programmers, but I found almost no documentation, lack of simplicity and questionable high performance - what I mean is that we needed to send 2000 messages per second in our app, well, very few people usually need that much of a traffic, but shooting with MINA 1000 messages at one time brings not more than 900 at the other end.</description>
		<content:encoded><![CDATA[<p>I have always been on the same opinion with kmatveev. So finally I decided 3 years ago to make my own simple, scalable framework. It could sound as a advertisement, but if you look here <a href="http://javawork.org" rel="nofollow">javawork.org</a> you will find in the examples that it is really easy.</p>
<p>Apache MINA has always been the preferred choice by many programmers, but I found almost no documentation, lack of simplicity and questionable high performance &#8211; what I mean is that we needed to send 2000 messages per second in our app, well, very few people usually need that much of a traffic, but shooting with MINA 1000 messages at one time brings not more than 900 at the other end.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iamdeadly</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-374</link>
		<dc:creator>iamdeadly</dc:creator>
		<pubDate>Tue, 13 Jan 2009 22:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-374</guid>
		<description>i agree with kmatveev that there are already too many frameworks out there.  Often it takes more time to learn how to use a framework than using some basic API.  NIO is not complex.  The protocol symantics is what makes working with NIO difficult, not NIO itself.  Rolling up your own buffer and state managers might be easier than learning another framework.  i don&#039;t have anything against a framework but in the workplace, each developer brings  his own set of frameworks, and avoiding the less popular frameworks is sometimes preferable.   How many of us while doing software maintenance cursed the last developer just because he used some obscure framework.</description>
		<content:encoded><![CDATA[<p>i agree with kmatveev that there are already too many frameworks out there.  Often it takes more time to learn how to use a framework than using some basic API.  NIO is not complex.  The protocol symantics is what makes working with NIO difficult, not NIO itself.  Rolling up your own buffer and state managers might be easier than learning another framework.  i don&#8217;t have anything against a framework but in the workplace, each developer brings  his own set of frameworks, and avoiding the less popular frameworks is sometimes preferable.   How many of us while doing software maintenance cursed the last developer just because he used some obscure framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gustav</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-343</link>
		<dc:creator>gustav</dc:creator>
		<pubDate>Mon, 28 Jul 2008 13:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-343</guid>
		<description>hm.

how about you check with current technology instead of living in old dead mantras.

NIO is currently not faster then blocking IO.
just test it with a linux 2.6 kernel with its NPTL.

you will see that for loads at thousands of connections, blocking IO wins with roughly 25% in all kinds of tests.

if you run windows etc, well its your own fault if thinking its a good server.</description>
		<content:encoded><![CDATA[<p>hm.</p>
<p>how about you check with current technology instead of living in old dead mantras.</p>
<p>NIO is currently not faster then blocking IO.<br />
just test it with a linux 2.6 kernel with its NPTL.</p>
<p>you will see that for loads at thousands of connections, blocking IO wins with roughly 25% in all kinds of tests.</p>
<p>if you run windows etc, well its your own fault if thinking its a good server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mondain</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-322</link>
		<dc:creator>Mondain</dc:creator>
		<pubDate>Thu, 24 Apr 2008 23:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-322</guid>
		<description>kmatveev - you ask for an example of a widespread server using a framework on your list? Red5 is such a server, its an open source Flash media server. I am a core dev on the team and I love working with Mina, I&#039;m not saying custom NIO wouldn&#039;t be faster but I don&#039;t have time to maintain such a library. If you want to waste time &quot;rolling&quot; your own for everything instead of using pre-built libraries that is your choice.

http://osflash.org/red5</description>
		<content:encoded><![CDATA[<p>kmatveev &#8211; you ask for an example of a widespread server using a framework on your list? Red5 is such a server, its an open source Flash media server. I am a core dev on the team and I love working with Mina, I&#8217;m not saying custom NIO wouldn&#8217;t be faster but I don&#8217;t have time to maintain such a library. If you want to waste time &#8220;rolling&#8221; your own for everything instead of using pre-built libraries that is your choice.</p>
<p><a href="http://osflash.org/red5" rel="nofollow">http://osflash.org/red5</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kmatveev</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-321</link>
		<dc:creator>kmatveev</dc:creator>
		<pubDate>Thu, 24 Apr 2008 07:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-321</guid>
		<description>Just several &lt;a href=&quot;http://www.cs.yale.edu/quotes.html&quot; rel=&quot;nofollow&quot;&gt;quotes&lt;/a&gt; from Alan Perlis, which apply wery well to those frameworks.

14. In the long run every program becomes rococo - then rubble.

30. In programming, everything we do is a special case of something more general -- and often we know it too quickly. 

52. Systems have sub-systems and sub-systems have sub- systems and so on ad infinitum - which is why we&#039;re always starting over. 

And that is my point of view:

31. Simplicity does not precede complexity, but follows it.</description>
		<content:encoded><![CDATA[<p>Just several <a href="http://www.cs.yale.edu/quotes.html" rel="nofollow">quotes</a> from Alan Perlis, which apply wery well to those frameworks.</p>
<p>14. In the long run every program becomes rococo &#8211; then rubble.</p>
<p>30. In programming, everything we do is a special case of something more general &#8212; and often we know it too quickly. </p>
<p>52. Systems have sub-systems and sub-systems have sub- systems and so on ad infinitum &#8211; which is why we&#8217;re always starting over. </p>
<p>And that is my point of view:</p>
<p>31. Simplicity does not precede complexity, but follows it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kmatveev</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-320</link>
		<dc:creator>kmatveev</dc:creator>
		<pubDate>Thu, 24 Apr 2008 07:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-320</guid>
		<description>I&#039;m surprized to see that NIO frameworks make code fast. There are no magic inside them. They don&#039;t encapsulate any clever algorithm, it&#039;s just a set of abstract classes connected in patterns. Yes, there are concrete classes there, but they are mostly wrappers. So, by taking a code which uses NIO framework and inlining about 70% of methods it is possible to get plain NIO code, which will work slightly faster (because of method inlining) and will be much simpler (in my opinion).

For me, main selling point of those frameworks is flexibility, because there are interfaces for everything.However, I don&#039;t need this flexibility.

I never wanted to say that those frameworks are slow. Their authors will claim that &quot;you are just using them in wrong way&quot;. But that is exactly my point: instead of doing something in straight way, you need spend time learning those frameworks.

It is always possible to prove that those frameworks are not flexible enough for your case. But then authors will introduce additional layer of interfaces to satisfy you.

Yes, my evaluation is not deep, but this is exactly the point: they are useless in advance, and even require learning. I don&#039;t want to learn pipeline models of those frameworks, because I strongly suspect that it is a several layers of abstractions made over something very simple. I don&#039;t want to follow stupid patterns, becase someone considers them good, and because of abstract virtues of &quot;separation of concerns&quot;. I belive that all those frameworks are very similar, and no one has clear benefits compared to others. It is not worth my time to see how they are different between each other, because I&#039;m certain that finally I&#039;ll discover that they are clones of each others, just classes have different names.

Yes, this article doesn&#039;t look like serious investigation, but it didn&#039;t mean to. There are no need to look deep in code to understand that it is worthless. I know that just because socket servers simple enough to be written in plain form.

But, if anyone wants other arguments, I have one more. Look at MINA, especially package org.apache.mina.transport.socket. There is a large amont of methods consisting of 1-3 lines of code. Just wrappers, sometimes with exception catching. This is called &quot;code smell&quot;, and naturally solved by refactoring &quot;inline&quot;.

Can anybody name a really usefull and widespread server product which uses those libraries ? Can anybody explain why C programmers live happily without such frameworks ? Can anybody explain if those libraries are so good, why there are so many of them ?</description>
		<content:encoded><![CDATA[<p>I&#8217;m surprized to see that NIO frameworks make code fast. There are no magic inside them. They don&#8217;t encapsulate any clever algorithm, it&#8217;s just a set of abstract classes connected in patterns. Yes, there are concrete classes there, but they are mostly wrappers. So, by taking a code which uses NIO framework and inlining about 70% of methods it is possible to get plain NIO code, which will work slightly faster (because of method inlining) and will be much simpler (in my opinion).</p>
<p>For me, main selling point of those frameworks is flexibility, because there are interfaces for everything.However, I don&#8217;t need this flexibility.</p>
<p>I never wanted to say that those frameworks are slow. Their authors will claim that &#8220;you are just using them in wrong way&#8221;. But that is exactly my point: instead of doing something in straight way, you need spend time learning those frameworks.</p>
<p>It is always possible to prove that those frameworks are not flexible enough for your case. But then authors will introduce additional layer of interfaces to satisfy you.</p>
<p>Yes, my evaluation is not deep, but this is exactly the point: they are useless in advance, and even require learning. I don&#8217;t want to learn pipeline models of those frameworks, because I strongly suspect that it is a several layers of abstractions made over something very simple. I don&#8217;t want to follow stupid patterns, becase someone considers them good, and because of abstract virtues of &#8220;separation of concerns&#8221;. I belive that all those frameworks are very similar, and no one has clear benefits compared to others. It is not worth my time to see how they are different between each other, because I&#8217;m certain that finally I&#8217;ll discover that they are clones of each others, just classes have different names.</p>
<p>Yes, this article doesn&#8217;t look like serious investigation, but it didn&#8217;t mean to. There are no need to look deep in code to understand that it is worthless. I know that just because socket servers simple enough to be written in plain form.</p>
<p>But, if anyone wants other arguments, I have one more. Look at MINA, especially package org.apache.mina.transport.socket. There is a large amont of methods consisting of 1-3 lines of code. Just wrappers, sometimes with exception catching. This is called &#8220;code smell&#8221;, and naturally solved by refactoring &#8220;inline&#8221;.</p>
<p>Can anybody name a really usefull and widespread server product which uses those libraries ? Can anybody explain why C programmers live happily without such frameworks ? Can anybody explain if those libraries are so good, why there are so many of them ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-314</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 23 Apr 2008 21:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-314</guid>
		<description>Interesting topic, but you don&#039;t go into your evaluations in enough depth for your opinion to be worth much to me. I would like to see more information about what you did to actually evaluate the frameworks beyond counting classes.

Ultimately this article boils down to the following summary: &quot;Here are four NIO frameworks. Don&#039;t use them. They are tricky.&quot; How? Why? Concrete examples and comparisons please.</description>
		<content:encoded><![CDATA[<p>Interesting topic, but you don&#8217;t go into your evaluations in enough depth for your opinion to be worth much to me. I would like to see more information about what you did to actually evaluate the frameworks beyond counting classes.</p>
<p>Ultimately this article boils down to the following summary: &#8220;Here are four NIO frameworks. Don&#8217;t use them. They are tricky.&#8221; How? Why? Concrete examples and comparisons please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lapo</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-313</link>
		<dc:creator>Lapo</dc:creator>
		<pubDate>Wed, 23 Apr 2008 10:38:57 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-313</guid>
		<description>Nice to see a post like this. Of course there&#039;s no solution that fits all possibilities and requirement but having developed socket servers for the last 5 years of so I&#039;ve been playing with many of these libraries and found out that a custom NIO engine can outperform any of these framework by different orders of magnitude.

I am not starting a fight between custom-brewed NIO vs frameworks or similar... each task requires the proper tool. I&#039;ve been using MINA and xSocket when I was in a hurry and didn&#039;t mind about the ultimate performance. They worked okay with a few problems here and there, but acceptable.

For very high performance a custom solution worked much much better than Mina, so I agree with the &quot;too generic framework&quot;  critique.

If you&#039;re curious about it I&#039;ve published (last summer) a few comparison tests between a Mina-based socket server and our custom-NIO engine -&gt; http://www.smartfoxserver.com/forums/viewtopic.php?t=1850&amp;highlight=mina</description>
		<content:encoded><![CDATA[<p>Nice to see a post like this. Of course there&#8217;s no solution that fits all possibilities and requirement but having developed socket servers for the last 5 years of so I&#8217;ve been playing with many of these libraries and found out that a custom NIO engine can outperform any of these framework by different orders of magnitude.</p>
<p>I am not starting a fight between custom-brewed NIO vs frameworks or similar&#8230; each task requires the proper tool. I&#8217;ve been using MINA and xSocket when I was in a hurry and didn&#8217;t mind about the ultimate performance. They worked okay with a few problems here and there, but acceptable.</p>
<p>For very high performance a custom solution worked much much better than Mina, so I agree with the &#8220;too generic framework&#8221;  critique.</p>
<p>If you&#8217;re curious about it I&#8217;ve published (last summer) a few comparison tests between a Mina-based socket server and our custom-NIO engine -&gt; <a href="http://www.smartfoxserver.com/forums/viewtopic.php?t=1850&amp;highlight=mina" rel="nofollow">http://www.smartfoxserver.com/forums/viewtopic.php?t=1850&amp;highlight=mina</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kmatveev</title>
		<link>http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/#comment-312</link>
		<dc:creator>kmatveev</dc:creator>
		<pubDate>Wed, 23 Apr 2008 10:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://technfun.wordpress.com/?p=64#comment-312</guid>
		<description>For Mike:

Hello man! You start your comment by questioning my if my experience is big enough to have right to judge about this code. Well, I suppose it is big enough, because I don&#039;t think that &quot;NIO is tricky&quot;, as you say. You accuse me of being &quot;authoritan&quot;, but I never use words like &quot;must&quot;/&quot;mustn&#039;t&quot;, I always say that it is just my opinion. And hey, this is my blog, I can express my opinion here! I understand that my article had probably hurt your feelings, that&#039;s why you are attacking me personally, not my arguments. Please, don&#039;t be rude next time! Oh dear, this blog was so quiet, but I&#039;m afraid it will be a place of flamewar.

OK, let&#039;s go to the matter. 

You say &quot;read/write buffer management can be tricky to achieve good performance&quot;. I can&#039;t figure out what do you mean here. That bulk ByteBuffer.get() is faster than invoking ByteBuffer.get() for each byte? Or that it is easy to forget to call ByteBuffer.flip() ? That&#039;s not tricky, in my opinion. You say &quot;dealing with packet fragmentation is difficult&quot;. That is also strange for me, because UDP re-assembles a datagram for you, and reading single data from TCP stream in several parts is not tricky at all. Buffer overflow ? But I see that read() and write() methods of channels check borders of ByteBuffers!

Then I say that I don&#039;t like that task should be modified to fit into a framework, I meant that event-driven implementation is easier for me to do manually, through Executor interface.

Just to convince you that my opinion deserves to be available, I will tell you why I&#039;ve written this. I&#039;m dealing with high-performance networking for 3 years already. Sometimes my collegues ask me: &quot;what do you think about this library&quot; ? So, I&#039;ve spent my time and evaluated them. Just bloat. Too many classes. Too deep hierarchies. They don&#039;t worth it.

By the way, maybe you know why Tomcat and James don&#039;t use this library ?</description>
		<content:encoded><![CDATA[<p>For Mike:</p>
<p>Hello man! You start your comment by questioning my if my experience is big enough to have right to judge about this code. Well, I suppose it is big enough, because I don&#8217;t think that &#8220;NIO is tricky&#8221;, as you say. You accuse me of being &#8220;authoritan&#8221;, but I never use words like &#8220;must&#8221;/&#8221;mustn&#8217;t&#8221;, I always say that it is just my opinion. And hey, this is my blog, I can express my opinion here! I understand that my article had probably hurt your feelings, that&#8217;s why you are attacking me personally, not my arguments. Please, don&#8217;t be rude next time! Oh dear, this blog was so quiet, but I&#8217;m afraid it will be a place of flamewar.</p>
<p>OK, let&#8217;s go to the matter. </p>
<p>You say &#8220;read/write buffer management can be tricky to achieve good performance&#8221;. I can&#8217;t figure out what do you mean here. That bulk ByteBuffer.get() is faster than invoking ByteBuffer.get() for each byte? Or that it is easy to forget to call ByteBuffer.flip() ? That&#8217;s not tricky, in my opinion. You say &#8220;dealing with packet fragmentation is difficult&#8221;. That is also strange for me, because UDP re-assembles a datagram for you, and reading single data from TCP stream in several parts is not tricky at all. Buffer overflow ? But I see that read() and write() methods of channels check borders of ByteBuffers!</p>
<p>Then I say that I don&#8217;t like that task should be modified to fit into a framework, I meant that event-driven implementation is easier for me to do manually, through Executor interface.</p>
<p>Just to convince you that my opinion deserves to be available, I will tell you why I&#8217;ve written this. I&#8217;m dealing with high-performance networking for 3 years already. Sometimes my collegues ask me: &#8220;what do you think about this library&#8221; ? So, I&#8217;ve spent my time and evaluated them. Just bloat. Too many classes. Too deep hierarchies. They don&#8217;t worth it.</p>
<p>By the way, maybe you know why Tomcat and James don&#8217;t use this library ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
