Re: Terminology: Inheritance through a component



>> Now you want to change A so that it inherits from B. If you do that, you
>> no
>> longer to have A contain an object of type B because A will become an
>> object
>> of type B.
>
> That would be true for most OO languages (those that have automatic data
> inheritance). Maybe I should have stated earlier that the background is
> Perl OO.
>
> It's different there. If you want data inheritance you must support it,
> and containing an object of the base class is one way of doing that.

Then you may or may not have inheritance. You certainly have delegation.

Inheritance is key to the Liskov Substitution Principle. The idea is that
each of the subclasses of a base class can be substituted for one another,
and for the base class, if the calling code uses an object of the base class
type. This is fundamental to many OO patterns. This is strongly typed in
all of the languages I am aware of. Therefore, the compiler will complain
if a parameter is expected to be of type B and type A is passed unless A is
a descendent of B in some way. I cannot tell from your description if the
LSP is supported in your language. If it isn't then, regardless of what you
call it, the developer won't benefit from the constructs. I do not know the
Perl variants, so I cannot say for sure. My apologies.

If A inherits from B, then A "is-a" B. That "is-a" relationship is
important. If you do not have this, then, IMHO, you do not have
inheritance.

>> Normally, the objects of type A would simply delegate their effort to
>> the object of type B that is contained within it.
>
> Quite so, that's the idea. In Perl it requires some effort to make that
> happen. I'm automating most of it, and I'm looking for a name for the
> process.
>

Is the underlying desire of this discussion that you get a name, from us,
for you to use when "selling" your automation product?

How about this: You have created a code generator that automates the effort
to script delegation. You did this with the intent of providing the
developer with productivity that begins to approach that of a formal OO
language, while still allowing them to leverage their skills is their
favorite interpreted scripting language.

These kinds of phrases are familiar to anyone using the automation products
that purport to do the same thing for VB6.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--


.



Relevant Pages