<br><br>
<div><span class="gmail_quote">On 5/1/06, <b class="gmail_sendername">SmallSqueak</b> &lt;<a href="mailto:smallsqueak@rogers.com">smallsqueak@rogers.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">About adding methods to existing classes ....<br><br>&nbsp;&nbsp; Is this a rule, that I have to add methods to existing classes?
<br>&nbsp;&nbsp; Would you please explain why it is a good thing.</blockquote>
<div>&nbsp;</div>
<div>You don't have to, but you can.&nbsp; You can't do it in C++ or Java.&nbsp; It is a good thing because sometimes when you want to extend a system, you want old objects to interact well with new objects, and it is easier if you can add methods to old objects.&nbsp; And I really mean &quot;old objects&quot; and not just &quot;old classes&quot;, though of course that is included.
</div>
<div>&nbsp;</div>
<div>Suppose you want to add a new kind of tool to the system, one that helps you debug objects.&nbsp; You want to be able to send a message &quot;debug&quot; to every object.&nbsp; You can add a default &quot;debug&quot; method to class Object and override that method in classes that need a different implementation.&nbsp; 
</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&nbsp;&nbsp; What if the authors of the existing classes don't want<br>&nbsp;&nbsp; anything added to their classes?</blockquote>

<div>&nbsp;</div>
<div>When you publish the source code to something, it is a gift to the world.&nbsp; The world can do what it wants with it.&nbsp; If you think the world is better off without adding methods to a particular class, by all means write a comment to that effect.&nbsp; But you might be wrong, and the world will show you by adding methods anyway.
</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&gt; Just focus on Collection classes and numbers.<br><br>&nbsp;&nbsp; I like to ignore these as well.</blockquote>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>I think this is a mistake.&nbsp; The collection classes are very important.&nbsp; They are also great examples of well-designed Smalltalk classes.</div>
<div>&nbsp;</div>
<div>-Ralph Johnson</div><br>&nbsp;</div>