Association or Inheritance
From: Ashima Goswamy (ashimag_at_bolt.com)
Date: 02/26/04
- Next message: jionglee_at_163.net: "Re: Design Pattern Newbie Question:about creating object"
- Previous message: Tum: "files, directories, files, directories"
- Next in thread: Cristiano Sadun: "Re: Association or Inheritance"
- Reply: Cristiano Sadun: "Re: Association or Inheritance"
- Reply: Robert Klemme: "Re: Association or Inheritance"
- Reply: Doc O'Leary: "Re: Association or Inheritance"
- Reply: Kevin Cline: "Re: Association or Inheritance"
- Reply: Doug Pardee: "Re: Association or Inheritance"
- Reply: H. S. Lahman: "Re: Association or Inheritance"
- Reply: Robert C. Martin: "Re: Association or Inheritance"
- Reply: Daniel T.: "Re: Association or Inheritance"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: jionglee_at_163.net: "Re: Design Pattern Newbie Question:about creating object"
- Previous message: Tum: "files, directories, files, directories"
- Next in thread: Cristiano Sadun: "Re: Association or Inheritance"
- Reply: Cristiano Sadun: "Re: Association or Inheritance"
- Reply: Robert Klemme: "Re: Association or Inheritance"
- Reply: Doc O'Leary: "Re: Association or Inheritance"
- Reply: Kevin Cline: "Re: Association or Inheritance"
- Reply: Doug Pardee: "Re: Association or Inheritance"
- Reply: H. S. Lahman: "Re: Association or Inheritance"
- Reply: Robert C. Martin: "Re: Association or Inheritance"
- Reply: Daniel T.: "Re: Association or Inheritance"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|