Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.object Subject: Re: Objects and Interactions: Separate Definitions Message-ID: <1991May22.012821.12048@tkou02.enet.dec.com> Date: 22 May 91 01:28:21 GMT References: <3999@motcsd.csd.mot.com> <1991May21.064913.16149@netcom.COM> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Distribution: comp Organization: Digital Equipment Corporation Japan , Tokyo Lines: 33 In article <1991May21.064913.16149@netcom.COM> jls@netcom.COM (Jim Showalter) writes: [attribution lost]: >]>> or (2) the objects have methods that report their "comparable value" >]>>and size in canonical forms that a generic routine in the heap object >]>>can operate on. Neither of these makes me awfully happy. > >Why does 2 make you unhappy? ... "separation of concerns": one program >entity knows how to quicksort stuff (arbitrary stuff), ... the >responsibility for providing a "<" operation belongs to the client >providing the stuff. Responsibility for specifying a "<" operation belongs to the call site. For example, people have family names and given names. One might want to sort people's names to create a Western-style phone book or a Japanese-style phone book. To create a Western-style phone book, the key for a person's name is the family name followed by the given names. To create a Japanese-style phone book, the key for a Japanese person's name is the family name followed by the given name, while the key for a foreigner's name is the given names followed by the family name.(*) A person-object has a family name and given names, but can't construct the correct key for a "<" operation without knowing which "<" operation suits the call site. I do agree that the sorter entity should not specify the "<" operation. I think the call site has to specify it. (* My personal opinion is that Japanese don't know how to make a phone book, and that the inconsistency is mildly racist; -- DISCLAIMER: my employer has stated its disagreement with my opinion.) -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. Permission is granted to feel this signature, but not to look at it.