On Oct 6, 10:13 pm, "Michael T. Richter" <ttmrich... / gmail.com> wrote:
> On Sun, 2007-07-10 at 07:21 +0900, Austin Ziegler wrote:
> > I'd say it should be avoided 98% of the time (MI). Inheritance in
> > general, is probably overused by at least 50%. (Most is-a
> > relationships aren't useful ones and are caused by people who aren't
> > used to thinking of OOP in other terms. I'm not suggesting this for
> > you, but is-a has a lot of implications that has-a doesn't. Therefore,
> > it's not "you-should-not-use-inheritance crap", it's sound advice from
> > years in the industry.)
>
> Going back to the original model that sparked this: inheritance reflects
> an "is-a" relationship.  Someone wants to make an application object
> that:
>
>      1. IS-A Linux application; and
>      2. IS-A video player application.
>
> What stymies me here is... exactly which runtime is this going to be
> running in where you can plug in a Linux application, a Windows
> application or a ... Symbian, say, application and need the transparent
> dispatching to the right functionality?  Just the "LinuxApplication"
> class by itself makes me suspicious of the model behind it: what useful
> abstraction do you get from this that you don't get from an
> "Application" that has a "POSIXFileSystem" (instead of "NTFSFileSystem")
> and a "LinuxSecurityModel" (instead of "NTSecurityModel") or whatever?
> Just this core has me scratching my head.
>
> Adding the "VideoPlayerApplication" to the mix only raises even more
> questions, all related, once again, to the nature of a runtime where you
> need transparent dispatching to a VideoPlayerApplication over ... what,
> exactly?  A VideoRecorderApplication?  An AudioPlayerApplication?  A
> RealTimeAutomobileAssembleyApplication?
>
> Basically, I'm failing to see any useful "IS-A" relationships at all in
> the original poster's model barring an awfully convoluted run-time with
> some questionable approaches to things built into it.  What he's viewing
> as inheritance (IS-A) situations to me look like composition (HAS-A)
> situations.
>
> And this is what strikes me about most C++ code: people using IS-A left,
> right and centre because that's what the language supports best; C++ is
> positively lousy at supporting HAS-A relationships (and Java isn't much
> better).

You're assuming too much from the names. I'm just working on improving
Launchy to add a video player launcher, in the process I worked on the
overall code to make it more OOP.

  http://rubyforge.org/projects/copiousfreetime/

T.