home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / object / 5032 < prev    next >
Encoding:
Text File  |  1993-01-24  |  3.1 KB  |  79 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!newsflash.concordia.ca!nstn.ns.ca!dragon.acadiau.ca!880445p
  3. From: 880445p@dragon.acadiau.ca (Ravi Palepu)
  4. Subject: Re: Non-Compatible Type Inheritance in Booch's Method?
  5. Message-ID: <1993Jan24.052355.16998@dragon.acadiau.ca>
  6. Organization: Acadia University
  7. References: <1993Jan21.084130.5007@dragon.acadiau.ca> <rmartin.727741373@thor>
  8. Date: Sun, 24 Jan 1993 05:23:55 GMT
  9. Lines: 68
  10.  
  11. rmartin@thor.Rational.COM (Bob Martin) writes:
  12.  
  13. >Ravi Palepu writes:
  14.  
  15. >>Could someone shed some light on inheritance relationships that are
  16. >>|not type compatible? (Class Diagrams from 5.2 of OOD w Apps) 
  17.  
  18. >You can get a copy of Booch's latest paper on the Notation by mailing
  19. >a request to prod_info@rational.com
  20.  
  21. >The notation now supports the inheritance arrow in public, private and
  22. >protected forms.
  23.  
  24. >        -----------> public inheritance
  25.  
  26. >        --|--------> protected inheritance
  27.  
  28. >        --||-------> private inheritance
  29.  
  30. >The old, "inherits (new type) relationship is now a private
  31. >inheritance relationship.  It indicates that the inheriting class does
  32. >not conform to the ISA relationship.  The public interface of the
  33. >base class is not visible to clients of the subclass.  Thus, the
  34. >subclass is a new type, rather than a type which is compatible with
  35. >the base class....
  36.  
  37. >Although there are some good reasons for using private inheritance
  38. >from time to time, it is usually preferable to use private
  39. >containment.
  40.  
  41. >--
  42. >Robert Martin       | Design Consulting    | Training courses offered:
  43. >R. C. M. Consulting | rmartin@rational.com |  Object Oriented Analysis
  44. >2080 Cranbrook Rd.  | Tel: (708) 918-1004  |  Object Oriented Design
  45. >Green Oaks, Il 60048| Fax: (708) 918-1023  |  C++
  46.  
  47. Thanks to Robert and to the others who sent responses directly to me.
  48.  
  49. Is the 'new' notation becoming less general and more focused on C++?
  50. Possibly, other types of inheritance can be mapped onto the three
  51. described above. Smalltalk class inheritance can be mapped onto
  52. protected inheritance (although it offers a lesser degree of encapsulation).
  53.  
  54. On the assumption that private inheritace is equivalent to C++'s private
  55. inheritance:
  56. I do have question, why can we say that 'inherited (new type)' relationship
  57. is equivalent to private.  The 'inheritance (new type)' was presumably 
  58. developed from the existence of Ada's Derived Type. Although 
  59. the term 'inheritance' is not associated with that type, it is referred
  60. to in Booch's book as an example of this relationship.
  61.  
  62. The Derived Type has the same interface as its base(parent). It needs a
  63. explicit type conversion to its base.  Sub-classes derived with 
  64. private inheritance have a different interface and they
  65. can be implicit converted to their base class.  
  66.  
  67. I see that another relationship type might be added --!------>
  68. (which is the case of being everything to everybody )
  69. or a redefinition might be in order (in order to map it onto an
  70. existing relationship type (protected seems more reasonable)). 
  71.  
  72. Any comments:
  73. If you do have any comments, and you don't feel like replying on the net,
  74. please do not hesitate to contact me directly.  I have started to use this
  75. notation extensively, and I would like to incorporate any improvements. 
  76.  
  77. -Ravi Palepu
  78.  
  79.