home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!utcsri!torn!nott!bnrgate!bcrka451!bcrki65!sjm
- From: sjm@bcrki65.bnr.ca (Stuart MacMartin)
- Subject: Re: A Pre-Release FAQ
- Message-ID: <1993Jan4.151738.11409@bcrka451.bnr.ca>
- Sender: 5E00 Corkstown News Server
- Organization: Bell-Northern Research Ltd., Ottawa, Canada
- References: <11534@uqcspe.cs.uq.oz.au>> <PCG.93Jan2211415@decb.aber.ac.uk> <11537@uqcspe.cs.uq.oz.au>
- Date: Mon, 4 Jan 1993 15:17:38 GMT
- Lines: 52
-
- In article <11537@uqcspe.cs.uq.oz.au> king@cs.uq.oz.au writes:
- >[I won't speculate further on Booch's intentions for not elaborating
- >on the distinction between classes and types. I don't think ridicule
- >or support for his actions based on speculation really gets us anywhere.
- >The important thing is to clarify our thoughts.]
-
- For OOD, the distinction between type and class is not necessary,
- perhaps?
-
- >
- >In <PCG.93Jan2211415@decb.aber.ac.uk> pcg@aber.ac.uk (Piercarlo Grandi) writes:
- >
- >pcg>On 1 Jan 93 21:56:57 GMT, king@cs.uq.oz.au (Paul King) said:
- >
- >king> I do not believe there is a lot to be gained by placing too much
- >king> emphasis on the difference between type and class (and I have read
- >king> numerous articles on this topic - all of which still leave me
- >king> unconvinced).
- >
- >The type of an object then
- >is the behaviour of (representation) values it can take on. The class
- >is one way of defining these values.
-
- When we equate type with class, we think of things in terms of
- discrete, finite types. This works well for many things. However, if
- by type we mean a classification of objects: "an object is of type X
- if it is allowed to have the following states and the following
- behaviour", then we can have a continuum of types from the generic to
- the specific, and an infinite number of these continuums. We obviously
- do not implement an infinite number of classes.
-
- Inheritance captures the type relationship of general <--> specific.
- It does not capture mutability relationships, for example. As a plastic
- cup melts on the stove, it starts out as a cup and ends up as a mess.
- From the cup and the environment, we might be able to predict the mess,
- but we can't work backwards: there are several starting points that
- could have resulted in the same mess. The object has mutated from one
- type into another, and it presumably has undergone a mutation through
- an infinite number of types.
-
- I see nothing wrong with equating types and classes while solving many
- of today's practical programming problems. But in general, the mindset
- of type == class can restrict our approach to problems. I think we
- need an advance guard always thinking about "what is a type" and "what
- is a better way of modelling types?".
-
- Stuart
-
- --
- : Stuart MacMartin email: sjm@bnr.ca :
- : Bell-Northern Research phone: (613) 763-5625 :
- : PO Box 3511, Stn C, Ottawa, K1Y-4H7, CANADA Standard disclaimers apply. :
-