home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!newsflash.concordia.ca!nstn.ns.ca!dragon.acadiau.ca!880445p
- From: 880445p@dragon.acadiau.ca (Ravi Palepu)
- Subject: Re: Non-Compatible Type Inheritance in Booch's Method?
- Message-ID: <1993Jan24.052355.16998@dragon.acadiau.ca>
- Organization: Acadia University
- References: <1993Jan21.084130.5007@dragon.acadiau.ca> <rmartin.727741373@thor>
- Date: Sun, 24 Jan 1993 05:23:55 GMT
- Lines: 68
-
- rmartin@thor.Rational.COM (Bob Martin) writes:
-
- >Ravi Palepu writes:
-
- >>Could someone shed some light on inheritance relationships that are
- >>|not type compatible? (Class Diagrams from 5.2 of OOD w Apps)
-
- >You can get a copy of Booch's latest paper on the Notation by mailing
- >a request to prod_info@rational.com
-
- >The notation now supports the inheritance arrow in public, private and
- >protected forms.
-
- > -----------> public inheritance
-
- > --|--------> protected inheritance
-
- > --||-------> private inheritance
-
- >The old, "inherits (new type) relationship is now a private
- >inheritance relationship. It indicates that the inheriting class does
- >not conform to the ISA relationship. The public interface of the
- >base class is not visible to clients of the subclass. Thus, the
- >subclass is a new type, rather than a type which is compatible with
- >the base class....
-
- >Although there are some good reasons for using private inheritance
- >from time to time, it is usually preferable to use private
- >containment.
-
- >--
- >Robert Martin | Design Consulting | Training courses offered:
- >R. C. M. Consulting | rmartin@rational.com | Object Oriented Analysis
- >2080 Cranbrook Rd. | Tel: (708) 918-1004 | Object Oriented Design
- >Green Oaks, Il 60048| Fax: (708) 918-1023 | C++
-
- Thanks to Robert and to the others who sent responses directly to me.
-
- Is the 'new' notation becoming less general and more focused on C++?
- Possibly, other types of inheritance can be mapped onto the three
- described above. Smalltalk class inheritance can be mapped onto
- protected inheritance (although it offers a lesser degree of encapsulation).
-
- On the assumption that private inheritace is equivalent to C++'s private
- inheritance:
- I do have question, why can we say that 'inherited (new type)' relationship
- is equivalent to private. The 'inheritance (new type)' was presumably
- developed from the existence of Ada's Derived Type. Although
- the term 'inheritance' is not associated with that type, it is referred
- to in Booch's book as an example of this relationship.
-
- The Derived Type has the same interface as its base(parent). It needs a
- explicit type conversion to its base. Sub-classes derived with
- private inheritance have a different interface and they
- can be implicit converted to their base class.
-
- I see that another relationship type might be added --!------>
- (which is the case of being everything to everybody )
- or a redefinition might be in order (in order to map it onto an
- existing relationship type (protected seems more reasonable)).
-
- Any comments:
- If you do have any comments, and you don't feel like replying on the net,
- please do not hesitate to contact me directly. I have started to use this
- notation extensively, and I would like to incorporate any improvements.
-
- -Ravi Palepu
-
-