home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Squares and Rectangles (Re: Const Inheritance)
- Message-ID: <1992Nov19.171731.23740@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <721507350snx@trmphrst.demon.co.uk>
- Date: Thu, 19 Nov 1992 17:17:31 GMT
- Lines: 27
-
- In article <721507350snx@trmphrst.demon.co.uk> nikki@trmphrst.demon.co.uk writes:
- >In article <1992Nov4.165028.1273@wam.umd.edu> krc@wam.umd.edu (Kevin R. Coombes) writes:
- >> From a mathematical point of view, there is no question about the
- >> relationship that should hold. Every rectangle IS-A polygon, with
- >> four sides and four right angles. Every square IS-A rectangle with
- >> four equal sides.
-
- >I think our problem here is that we have two separate meanings of "is-a".
- >In the geometrical sense, any particular Square "is-a" Rectangle. But,
- >geometrically, the shape of any given object is fixed, so setWidth() and
- >setHeight() methods do not make sense geometrically. If you make all
- >objects of fixed size and shape, then a Square is-indeed-a Rectangle.
-
- More or less mathematical 'objects' are values, and not
- 'OO' objects (which tend to be mutable). Using classes for these things
- is more in the ADT flavour than OO.
-
- An abstract class 'Shape' may allow, for example an
- 'Expand' function for 'located' objects that have a definite
- point (about which to expand) and exist in a coordinate frame,
- but couldnt have a 'SetWidth' function.
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-