Association or Inheritance

From: Ashima Goswamy (ashimag_at_bolt.com)
Date: 02/26/04


Date: 25 Feb 2004 21:57:16 -0800

I am referring to a diagram on page 577 in Desmond D'Souza's book
"Objects, Components and Frameworks...", though I shall repeat the
relevatn parts of that diagram here for my question.

There are three classes: VideoStore, Video, and VideoTitle. The
distinction betwene Video and VideoTitles is required because there
may be many copies of a VideoTitle in the VideoStore. A customer
reserves a VideoTitle, but is issued a Video.

The book shows the relationship between VideoTitle and Video as a 1:*
association relationship. I am also convinced about it. But one of my
colleagues argued that it should be inheritance, i.e., Video should
inherit from VideoTitle. I had difficulty in convincing him about it.

Can somebody help me to explain what is wrong if we inherit Video from
VideoTitle, rather than have an association between them.

Thanks.

... Ash



Relevant Pages

  • Re: Association or Inheritance
    ... > relevatn parts of that diagram here for my question. ... VideoStore, Video, and VideoTitle. ... > inherit from VideoTitle. ...
    (comp.object)
  • Re: Association or Inheritance
    ... >> may be many copies of a VideoTitle in the VideoStore. ... >> reserves a VideoTitle, ... >> inherit from VideoTitle. ... Though types only make sense relative to context, ...
    (comp.object)
  • Re: Association or Inheritance
    ... VideoStore, Video, and VideoTitle. ... then its members are a complete set of the superclass members. ... The responsibilities of are likely to be around a {In Stock, ...
    (comp.object)
  • Re: Association or Inheritance
    ... > relevatn parts of that diagram here for my question. ... VideoStore, Video, and VideoTitle. ... Association is often called "hasA" relationship, while inheritance is ...
    (comp.object)
  • Re: Association or Inheritance
    ... VideoStore, Video, and VideoTitle. ... > inherit from VideoTitle. ...
    (comp.object)