To be blunt back (but intending no disrespect of course, as I respect your code and conversational contributions a great deal), aren't you showing a bit of bias here?  I see that you have a great dislike for MI and believe me, I share it with you.  However you do see Java interfaces as a separate entity, no?
<br><br>To me this is what Traits are, not a method of MI.&nbsp; And this is something missing we see in every &quot;OO-ish&quot; system.&nbsp; Ruby and Strongtalk (at least) made &quot;mixins&quot; to deal with it.&nbsp; Self went with something that looks like full-blown MI, etc., etc.&nbsp; What we seem to want in OO systems is basically a formalization of the protocols.&nbsp; Not just a textual category I can put the methods in, something first class.&nbsp; I can learn about an object by looking at the &quot;interfaces&quot;, &quot;traits&quot; or &quot;type classes&quot; (which ever you prefer) it supports via runtime reflection.&nbsp; I know you can ask the classes what methods are in what categories but that isn&#39;t a guarantee; the classifications are pure convention.
<br><br>Now, for sure people can abuse traits just as people abuse MI and even SI (look at half the Java hierarchies out there).&nbsp; In my first experience with Haskell type classes I abused them horribly to create effectively a class hierarchy.&nbsp; But misuse can indicate a faulty abstraction (
e.g. MI IMO), or that we simply need better training with it.<br><br>In the case of Nile here, I have not personally seen the code and it may indeed be overly complex.&nbsp; But to get to a correct, intuitive stream system how would you deal with the fact that some streams are, by nature read-only and even write-only?&nbsp; Surely not by a &quot;isReadOnly&quot; variable switch?
<br><br>Your concept of &quot;Fixed Size&quot;, &quot;Variable/Infinite Size&quot; and &quot;Transforming&quot; is solid.&nbsp; But I think such a setup would be benefited with traits to make the first class distinction between &quot;read&quot;, &quot;write&quot; or &quot;read-write&quot;.
<br><br>NOTE:&nbsp; Having said all this, my statements only stand for &quot;state-less&quot; traits.&nbsp; IMO &quot;stateful&quot; traits are exactly MI and therefor I am not a fan. :)<br><br><div><span class="gmail_quote">On 8/3/07, 
<b class="gmail_sendername">Andreas Raab</b> &lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Damien Cassou wrote:<br>&gt;&gt; If you were to structure a stream library along these lines I think<br>&gt;&gt; you&#39;ll find that most of the uses for traits would go away because<br>&gt;&gt; besides the core protocol (which would appear in class Stream) there is
<br>&gt;&gt; actually very little duplication of responsibilities in there.<br>&gt;<br>&gt; I do not agree. We will see what I can do and will discuss about this<br>&gt; later if you want. But, yes it&#39;s possible to avoid duplication,
<br>&gt; writing all the methods in the Stream class.<br><br>I understand that you can&#39;t possibly consider writing such a library<br>without using traits ;-) But to be blunt, since traits are a form of MI,<br>all the same methods of designing orthogonal systems apply that have for
<br>the last thirty years, and I&#39;m pretty sure it&#39;s not only possible but<br>actually (just as always with SI vs. MI) easier to understand.<br><br>Cheers,<br>&nbsp;&nbsp; - Andreas<br><br></blockquote></div><br>