<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">You really ought to look into ObjectiveC's Protocols.  Because they blow interfaces all to hell in terms of flexibility and Java's interfaces are borrowed from that (if one is to believe the Gosling apologists).<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I really like ObjectiveC's protocols and categories.  To me, traits look like categories with the class parameterized.  This is to say - you can declare a set of extension method in ObjectiveC as an extension on a particular class.  It would be nice to be able to declare that set of extension methods, then say later on to what classes they should be applied (which is kind of what traits does).  </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I really dislike Java's interfaces because they still leave you copying and pasting code like crazy or hand stitching glue.  </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>They only semi-sane strategy I've seen for sharing code is to store it in the interface as static methods (you can put static methods in an interface with implementation).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Then, you get to hand write a bunch of glue like this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>interface Foo</DIV><DIV>{</DIV><DIV>    abstract void bar();</DIV><DIV>    static void bar_impl(Foo f) { /*default implementation of foo */}</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>class Baz implements Foo</DIV><DIV>{</DIV><DIV>    void bar() { return Foo.bar_impl(this); }</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Which seems like a lot of busy work to me and makes me develop facial ticks everytime I contemplate using a large interface widely.</DIV><DIV>-Todd Blanchard</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Feb 23, 2007, at 10:35 PM, Andreas Raab wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Java interfaces are "nothing but abstract virtual base classes in C++" - which coincidentally, was the only way that MI ever worked in C++, which itself has two dozen ways of doing MI wrong and exactly ONE to do it right (abstract virtual base classes). Java choose a stand on that and it worked (which is pretty impressive given that it was the first language that used interface to that extent).</FONT></P> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>