home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / object / 3497 < prev    next >
Encoding:
Text File  |  1992-09-09  |  2.9 KB  |  67 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!munnari.oz.au!metro!graham
  3. From: graham@maths.su.oz.au (Graham Matthews)
  4. Subject: Re: Object-Oriented Methodologies - Class Specifications
  5. Message-ID: <graham.716087001@galois>
  6. Sender: graham@maths.su.oz.au
  7. Nntp-Posting-Host: galois.maths.su.oz.au
  8. Organization: School of Mathematics and Statistics, University of Sydney
  9. References: <graham.715918116@galois> <1992Sep8.183152.9350@neptune.inf.ethz.ch> <graham.716002888@galois> <1992Sep9.132319.20201@neptune.inf.ethz.ch>
  10. Date: Thu, 10 Sep 1992 01:03:21 GMT
  11. Lines: 54
  12.  
  13. graham@maths.su.oz.au (Graham Matthews) writes:
  14. >>You have to do more than this I think Phillip as you also have to
  15. >>get a new element for your carrier set. A field is a multiplicative
  16. >>group with addition and a zero element (I think I have this the
  17. >>right way round). So you have to pick up a zero somewhere in your
  18. >>carrier set.
  19.  
  20. santas@inf.ethz.ch (Philip Santas) writes:
  21. >My above solution was just a hint. Of course I do have more parameters:
  22. >Field((+,0),(*,1)) :< Group(+,0) /\ Field((+,0),(*,1)) :< Group(*,1)
  23. >or more general:
  24. >Field((op1,Zero),(op2,One)) :< Group(op1,Zero) /\ 
  25. >Field((op1,Zero),(op2,One)) :< Group(op2,One)
  26. >or
  27. >Field((op1,Zero),(op2,One)) :< (Group(op1,Zero) + Group(op2,One))
  28. >As you see we do not have just one class Ring or Group, but many of them.
  29.  
  30. I am not sure that this solves my problem. Lets turn this round.
  31. A car is a vehicle in the sense that to treat a car a vehicle I do
  32. not have to do anything. To treat a field as a group however I must
  33. be able to to throw away an element of my carrier set. Above you 
  34. describe which operations parameterise a group and a field, but you
  35. make no mention of the carrier set. How does the inheritance system
  36. know for example which element of the carrier set it must remove to
  37. view a field as a group?
  38.  
  39. >The above are functors which construct these classes.
  40. >You can say describe them as parameterised classes, but they are
  41. >actually functions which return classes.
  42.  
  43. And now we are getting closer to the point. These functors are maps
  44. between "types". They are relationships between types describing
  45. how one type may be views as another.
  46.  
  47. >Really, here _normal_ multiple subclassing does a pretty good job.
  48.  
  49. Perhaps we have a difference of taste here.
  50.  
  51. >The problem arises when we have instances of these classes,
  52. >ie. Reals, Rationals, Integers. Normal subclassing as it is understood
  53. >in traditional OOP, is _very_ poor indeed.
  54.  
  55. This reminds me of something else. Say I want to say that all rings
  56. are closed and finite (just assume they are). Now do I have to make
  57. some class heirarchy like closed_ring < finite_ring < ring, or perhaps
  58. I should make finite_ring < closed_ring < ring? Whichever I chose
  59. there is an implied order in the class heirarchy that is not in the
  60. mathematics. 
  61.  
  62. graham
  63. --
  64. Graham Matthews                 And it's true we are immune
  65. Pure Math, Uni.Sydney, Oz       When fact is fiction and T.V. is reality
  66. graham@maths.su.oz.au
  67.