[Newbies] is* methods

Michael Rueger m.rueger at acm.org
Fri Jan 25 11:55:07 UTC 2008


Blake wrote:
> Hello, all:
> 
>     While wandering through the (hefty) base Object class, I came across 
> the is* methods, which I had of course used many times.
> 
>     They're very convenient.

Yes, but the mantra should be: "Convenience is the death of good design"

> is: Class
>    ^(self class) inheritsFrom: Class

isKindOf: already exists.

> which would never have to be overridden? Obviously there are some is* 
> methods that server a larger purpose but isn't more...polymorphic...to say

is* is much much faster

But, as I said, using is* is a sign of a design problem. If you use is* 
you are hardwiring the knowledge about certain classes into your 
architecture.

Michael



More information about the Beginners mailing list