Xref: utzoo comp.lang.eiffel:1387 comp.object:2526 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bony1!richieb From: richieb@bony1.bony.com (Richard Bielak) Newsgroups: comp.lang.eiffel,comp.object Subject: Re: Inheritance and Information Hiding Message-ID: <1991Feb7.151212.25200@bony1.bony.com> Date: 7 Feb 91 15:12:12 GMT References: <488@eiffel.UUCP> <27A86309.281A@tct.uucp> <1991Feb1.135956.12425@tukki.jyu.fi> <27ADD06B.46A3@tct.uucp> <1991Feb5.130359.9735@bellcore.bellcore.com> <1991Feb6.045542.791@visix.com> Reply-To: richieb@bony1.UUCP (Richard Bielak) Organization: Bank of New York Lines: 33 In article <1991Feb6.045542.791@visix.com> adam@visix.com (Adam Kao) writes: > [...lots of stuff deleted...] >We know how to add vertices to POLYGONs. I think it ridiculous to say >we do not know how to add vertices to RECTANGLEs. The problem is, >adding a vertex to a RECTANGLE gives us something that is not a >RECTANGLE. > >I do not see this as a problem. Why do we expect that all operations >on an Object must be closed over its Class? > Perhaps the "add_vertex" routine should be a function? How about this: add_vertex : POLYGON is do -- whatever end; Then if "r" is a RECTANGLE, we can call "r.add_vertex" and get back an object that is not a RECTANGLE. ...richie -- +----------------------------------------------------------------------------+ | Richie Bielak (212)-815-3072 | "The sights one sees at times makes one | | Internet: richieb@bony.com | wonder if God ever really meant for | | Bang: uunet!bony1!richieb | man to fly." -- Charles Lindbergh |