home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!munnari.oz.au!metro!graham
- From: graham@maths.su.oz.au (Graham Matthews)
- Subject: Re: Object-Oriented Methodologies - Class Specifications
- Message-ID: <graham.716087001@galois>
- Sender: graham@maths.su.oz.au
- Nntp-Posting-Host: galois.maths.su.oz.au
- Organization: School of Mathematics and Statistics, University of Sydney
- References: <graham.715918116@galois> <1992Sep8.183152.9350@neptune.inf.ethz.ch> <graham.716002888@galois> <1992Sep9.132319.20201@neptune.inf.ethz.ch>
- Date: Thu, 10 Sep 1992 01:03:21 GMT
- Lines: 54
-
- graham@maths.su.oz.au (Graham Matthews) writes:
- >>You have to do more than this I think Phillip as you also have to
- >>get a new element for your carrier set. A field is a multiplicative
- >>group with addition and a zero element (I think I have this the
- >>right way round). So you have to pick up a zero somewhere in your
- >>carrier set.
-
- santas@inf.ethz.ch (Philip Santas) writes:
- >My above solution was just a hint. Of course I do have more parameters:
- >Field((+,0),(*,1)) :< Group(+,0) /\ Field((+,0),(*,1)) :< Group(*,1)
- >or more general:
- >Field((op1,Zero),(op2,One)) :< Group(op1,Zero) /\
- >Field((op1,Zero),(op2,One)) :< Group(op2,One)
- >or
- >Field((op1,Zero),(op2,One)) :< (Group(op1,Zero) + Group(op2,One))
- >As you see we do not have just one class Ring or Group, but many of them.
-
- I am not sure that this solves my problem. Lets turn this round.
- A car is a vehicle in the sense that to treat a car a vehicle I do
- not have to do anything. To treat a field as a group however I must
- be able to to throw away an element of my carrier set. Above you
- describe which operations parameterise a group and a field, but you
- make no mention of the carrier set. How does the inheritance system
- know for example which element of the carrier set it must remove to
- view a field as a group?
-
- >The above are functors which construct these classes.
- >You can say describe them as parameterised classes, but they are
- >actually functions which return classes.
-
- And now we are getting closer to the point. These functors are maps
- between "types". They are relationships between types describing
- how one type may be views as another.
-
- >Really, here _normal_ multiple subclassing does a pretty good job.
-
- Perhaps we have a difference of taste here.
-
- >The problem arises when we have instances of these classes,
- >ie. Reals, Rationals, Integers. Normal subclassing as it is understood
- >in traditional OOP, is _very_ poor indeed.
-
- This reminds me of something else. Say I want to say that all rings
- are closed and finite (just assume they are). Now do I have to make
- some class heirarchy like closed_ring < finite_ring < ring, or perhaps
- I should make finite_ring < closed_ring < ring? Whichever I chose
- there is an implied order in the class heirarchy that is not in the
- mathematics.
-
- graham
- --
- Graham Matthews And it's true we are immune
- Pure Math, Uni.Sydney, Oz When fact is fiction and T.V. is reality
- graham@maths.su.oz.au
-