<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Aaron Feng: Implementing Interface in JRuby</title>
    <link>http://www.aaronfeng.com/articles/2007/07/12/implementing-interface-in-jruby</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Adventures in software development</description>
    <item>
      <title>Implementing Interface in JRuby</title>
      <description>&lt;p&gt;Recently I decided to convert one of the tools I wrote in C# to JRuby.  During the process I needed to implement a Java interface in JRuby.  This sounds really weird to me because Ruby has no need for an interface because of the duck-typing system.  The syntax for implementing an interface in JRuby is shown below:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;class SomeClass
  include javax.swing.tree.TreeCellEditor
  # ...
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this case, SomeClass implements TreeCellEditor Java inteface.  It uses mix-in like syntax.  Prior to the 1.0 release, I believe it used ruby inheritance syntax instead of the current mix-in syntax.  That would look even more weird because Ruby doesn't support multiple inheritance and it will be confusing when you are implemneting an interface and extending a class.&lt;/p&gt;

&lt;p&gt;I don't know about you, but implementing an interface in Ruby still feels weird to me.&lt;/p&gt;</description>
      <pubDate>Thu, 12 Jul 2007 23:01:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e1ce2781-8c6d-4d17-a3e5-fe0f4ec8fef3</guid>
      <author>Aaron Feng</author>
      <link>http://www.aaronfeng.com/articles/2007/07/12/implementing-interface-in-jruby</link>
      <category>programming</category>
    </item>
    <item>
      <title>"Implementing Interface in JRuby" by thilinamb@gmail.com</title>
      <description>&lt;p&gt;this did not work for me. i tried to implement java.lang.Throwable interface.  dont know why...   :(&lt;/p&gt;

&lt;p&gt;buddhika&lt;/p&gt;</description>
      <pubDate>Wed, 21 Nov 2007 23:27:51 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:353e2721-2a6f-4151-a7bc-ee661aefc002</guid>
      <link>http://www.aaronfeng.com/articles/2007/07/12/implementing-interface-in-jruby#comment-4149</link>
    </item>
  </channel>
</rss>
