<?xml version="1.0"?>
<rss version="2.0">
<channel>
<link>http://helma.org/wiki/JavaScript+Inheritance+Sugar/</link>
<title>helma.org/wiki/JavaScript Inheritance Sugar</title>
<description>Updates for Page helma.org/wiki/JavaScript Inheritance Sugar</description>
<pubDate>Thu, 24 May 2012 14:52:26 +0000</pubDate>
<item>
<title>Version 4</title>
<link>http://helma.org/wiki/JavaScript+Inheritance+Sugar/history.diff?v=4</link>
<description>&lt;div class=&#39;diffbody&#39;&gt;&lt;table&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;6&lt;/td&gt;&lt;td&gt;* extending of priviledged methods is problematic. each constructor in the proto chain that gets called will create its own scope with its own private members and priviledged methods. Overriding priviledged methods will &lt;span class=&#39;diffremoved&#39;&gt;operate &lt;/span&gt;&lt;span class=&#39;diffadded&#39;&gt;result in those methods operating &lt;/span&gt;on a &lt;span class=&#39;diffremoved&#39;&gt;entirely &lt;/span&gt;different set of private variables&lt;span class=&#39;diffadded&#39;&gt;, leading very likely to unexpected results&lt;/span&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</description>
<pubDate>Fri, 28 Jul 2006 11:33:00 +0000</pubDate>
<author>hannes</author>
</item>
<item>
<title>Version 3</title>
<link>http://helma.org/wiki/JavaScript+Inheritance+Sugar/history.diff?v=3</link>
<description>&lt;div class=&#39;diffbody&#39;&gt;&lt;table&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;5&lt;/td&gt;&lt;td&gt;* the this.base property is set before each method call, and reset to its previous value afterwards. This isn&#39;t very &lt;span class=&#39;diffremoved&#39;&gt;elegant&lt;/span&gt;&lt;span class=&#39;diffadded&#39;&gt;elegant or efficient&lt;/span&gt;, and it doesn&#39;t deal with exceptions that might be thrown&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</description>
<pubDate>Fri, 28 Jul 2006 09:00:10 +0000</pubDate>
<author>hannes</author>
</item>
<item>
<title>Version 2</title>
<link>http://helma.org/wiki/JavaScript+Inheritance+Sugar/history.diff?v=2</link>
<description>&lt;ul class=&#39;diffproperties&#39;&gt;&lt;li&gt;Set &lt;span class=&#39;diffpropname&#39;&gt;tags&lt;/span&gt; to &lt;span class=&#39;diffadded&#39;&gt;javascript, inheritance, sugar&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&#39;diffbody&#39;&gt;&lt;table&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;5&lt;/td&gt;&lt;td&gt;* the this.base property is set &lt;span class=&#39;diffremoved&#39;&gt;to the parent prototype&#39;s method &lt;/span&gt;before each method call, and reset to its previous value afterwards. This isn&#39;t very elegant, and it doesn&#39;t deal with exceptions that might be thrown&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</description>
<pubDate>Fri, 28 Jul 2006 08:59:52 +0000</pubDate>
<author>hannes</author>
</item>
<item>
<title>Version 1</title>
<link>http://helma.org/wiki/JavaScript+Inheritance+Sugar/history.diff?v=1</link>
<description>&lt;div class=&#39;diffbody&#39;&gt;&lt;table&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;1&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;A few days ago, I came across Dean Edward&#39;s *Base Class for JavaScript Inheritance|http://dean.edwards.name/weblog/2006/03/base/*. I liked the general idea of adding syntactic sugar to JavaScript class-like inheritance. However, I think some things could be improved:&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;3&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;* the code of the Base class is pretty unreadable, because it tries to do too much in too little space&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;4&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;* methods in parent prototypes are called as this.base(), which looks nice but is far from self-explanatory and easily clashes with application methods or properties&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;5&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;* the this.base property is set to the parent prototype&#39;s method before each method call, and reset to its previous value afterwards. This isn&#39;t very elegant, and it doesn&#39;t deal with exceptions that might be thrown&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;6&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;* extending of priviledged methods is problematic. each constructor in the proto chain that gets called will create its own scope with its own private members and priviledged methods. Overriding priviledged methods will operate on a entirely different set of private variables.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;7&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;8&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;I&#39;ll describe my solution in an update to this page. For now, here&#39;s the code:&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;9&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;width:2em; color:#999;&quot;&gt;10&lt;/td&gt;&lt;td&gt;&lt;span class=&#39;diffadded&#39;&gt;&amp;lt;% this.attachments %&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;</description>
<pubDate>Fri, 28 Jul 2006 08:55:49 +0000</pubDate>
<author>hannes</author>
</item>
</channel>
</rss>

