[Newbies] OOP Question - adding methods to core classes

Ralph Johnson johnson at cs.uiuc.edu
Sun Oct 31 03:49:37 UTC 2010


On Sat, Oct 30, 2010 at 8:33 PM, Sean P. DeNigris <sean at clipperadams.com>wrote:

>        ]]
>
> I was thinking how beautiful this code could be if each class had it's own
> encode method, like:
>    In method protocol *xmlrpc
>        Symbol>>encodeForXmlRpc
>        String>>encodeForXmlRpc
>        etc.


Yes, this is the Smalltalk way.

When you add a method to existing classes, you want to try to avoid name
clashes.  Pick a name that nobody else is likely to use.   encodeForXmlRpc
is a good name for that reason.

-Ralph Johnson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20101030/e1582a9a/attachment.htm


More information about the Beginners mailing list