Newsgroups: comp.lang.c++,comp.lang.smalltalk,com.lang.eiffel
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.kei.com!news.mathworks.com!zombie.ncsc.mil!nntp.coast.net!chi-news.cic.net!uwm.edu!fnnews.fnal.gov!usenet.eel.ufl.edu!warwick!pcl!dicksoj
From: dicksoj@wmin.ac.uk (John Dickson)
Subject: Re: heterogeneous collections
Message-ID: <DJ9I80.HyE@westminster.ac.uk>
Sender: news@westminster.ac.uk
Nntp-Posting-Host: dip-3.dialup
Organization: University of Westminster
X-Newsreader: News Xpress Version 1.0 Beta #4
References: <30C6CB85.7B3D@jpmorgan.com> <4a84qd$9ko@newsbf02.news.aol.com>
Date: Fri, 8 Dec 1995 09:55:10 GMT
Lines: 33
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:164002 comp.lang.smalltalk:31763

In article <4a84qd$9ko@newsbf02.news.aol.com>,
   bytesmiths@aol.com (Bytesmiths) wrote:
..[snip]...
>
>This sounds like a potential problem, especially if his code ends up
>looking like:
>
>    portfolio do: [:financialObject |
>        (financialObject isKindOf: Bond) ifTrue:
>            [...]]
>
>We take such programmers out back and shoot them! :-) Better is to
>determine what it is about a Bond that makes it a bond, and then implement
>a common message like
>
>    isBondLike
>        "Do I have the unique characteristics of a bond?"
>
>which conceivably answers false in FinancialObject, true in Bond, and
>perhaps the result of an expression in a Derivative.

Jan,

Just before I take myself out the back and shoot myself (probably in the foot, 
as usual), could you explain why isKindOf: is so much worse than an explicit 
method in such cases?  I need the information for my epitaph ;-)

Cheers..........................JohnD

+--------------------------------------+----------------------------+
 \          John Dickson              /         Angle parked in      \
  \      (dicksoj@wmin.ac.uk)        /        a parallel universe...  \
   +--------------------------------+----------------------------------+
