<?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/"
		>
<channel>
	<title>Comments on: ruby notes 4a: overloading constructors</title>
	<atom:link href="http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/feed/" rel="self" type="application/rss+xml" />
	<link>http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/</link>
	<description></description>
	<lastBuildDate>Tue, 22 May 2012 01:20:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: John Cowan</title>
		<link>http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/comment-page-1/#comment-13547</link>
		<dc:creator>John Cowan</dc:creator>
		<pubDate>Tue, 02 Jan 2007 07:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/#comment-13547</guid>
		<description>It&#039;s pretty straightforward: when you call the new method on a Class object, it allocates space for the object using the primitive allocate instance method of Class, then invokes the initialize instance method on the new object, passing along the arguments of new.  That method can and usually should invoke the initialize method of its superclass .

If you want to override new, you can write your own new method, which may (for example) avoid calling superclass new when there is no need to actually construct a new object.</description>
		<content:encoded><![CDATA[<p>It&#8217;s pretty straightforward: when you call the new method on a Class object, it allocates space for the object using the primitive allocate instance method of Class, then invokes the initialize instance method on the new object, passing along the arguments of new.  That method can and usually should invoke the initialize method of its superclass .</p>
<p>If you want to override new, you can write your own new method, which may (for example) avoid calling superclass new when there is no need to actually construct a new object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david carlton</title>
		<link>http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/comment-page-1/#comment-13238</link>
		<dc:creator>david carlton</dc:creator>
		<pubDate>Sun, 31 Dec 2006 22:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/#comment-13238</guid>
		<description>I&#039;m thinking of getting rid of the public/private/protected notion for methods myself; I&#039;m not sure what that&#039;s buying me any more.

I confess I don&#039;t yet understand the details of the interactions between the class method &lt;code&gt;new&lt;/code&gt; and the instance method &lt;code&gt;initialize&lt;/code&gt; in Ruby, and in particular how to write replacements for the former.  It seems like it should be straightforward, but there&#039;s one sentence in the relevant section of the book that&#039;s confusing me.  I&#039;ll give it a try at some point...</description>
		<content:encoded><![CDATA[<p>I&#8217;m thinking of getting rid of the public/private/protected notion for methods myself; I&#8217;m not sure what that&#8217;s buying me any more.</p>
<p>I confess I don&#8217;t yet understand the details of the interactions between the class method <code>new</code> and the instance method <code>initialize</code> in Ruby, and in particular how to write replacements for the former.  It seems like it should be straightforward, but there&#8217;s one sentence in the relevant section of the book that&#8217;s confusing me.  I&#8217;ll give it a try at some point&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Cowan</title>
		<link>http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/comment-page-1/#comment-13220</link>
		<dc:creator>John Cowan</dc:creator>
		<pubDate>Sun, 31 Dec 2006 21:23:43 +0000</pubDate>
		<guid isPermaLink="false">http://malvasiabianca.org/archives/2006/12/ruby-notes-4a-overloading-constructors/#comment-13220</guid>
		<description>In Smalltalk, where the public/private status of a method is a matter of convention (all methods are public, all instance variables are protected), the convention is that you never call the &quot;initialize&quot; method of a class unless you are a constructor (class method) of that class.  Furthermore, if you always want your clients to invoke one or more specialized constructors, then you write a &quot;new&quot; class method that throws an error, and always use &quot;super new&quot; in your constructors.</description>
		<content:encoded><![CDATA[<p>In Smalltalk, where the public/private status of a method is a matter of convention (all methods are public, all instance variables are protected), the convention is that you never call the &#8220;initialize&#8221; method of a class unless you are a constructor (class method) of that class.  Furthermore, if you always want your clients to invoke one or more specialized constructors, then you write a &#8220;new&#8221; class method that throws an error, and always use &#8220;super new&#8221; in your constructors.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 5/14 queries in 0.113 seconds using disk: basic

Served from: malvasiabianca.org @ 2012-05-24 09:04:37 -->
