Re: Inheritance and Loaded Libraries
Re: Inheritance and Loaded Libraries
- Subject: Re: Inheritance and Loaded Libraries
- From: Matt Neuburg <email@hidden>
- Date: Sun, 07 Aug 2005 06:41:36 -0700
On Thu, 28 Oct 2004 21:40:06 +0100, has <email@hidden> said:
> Paul Berkowitz wrote:
>>
>>> A script's parent property can hold any type of object. When a script object
>>> receives a command it doesn't understand, it forwards that command to the
>>> object stored in its parent property. This is called 'delegation'.
>>>
>> I'm sure you're right. But AppleScript refers to it as "inheritance", even if
>> it shouldn't according to object-oriented languages (or you).
> I know, and it's misleading. With inheritance-based composition, the
> attributes defined in each class are all squidged together to define a new
> kind of object. Individual objects can then be created using that definition.
> With delegation-based composition, individual objects that are already in
> existence are linked together as a chain, allowing messages to pass
> automatically up and down that chain. None of this smooshing things together
> nonsense; each object retains its own identity. I suspected your 'only script
> or AppleScript objects can be parents' hypothesis might have been formed due
> to believing it was an inheritance-based relationship (where it would make
> sense), hence the explanation of what's actually going on by way of
> clarification.
>
> The ASLG's 'creative' explanation may have been used for familiarity's sake,
> since AppleScripters would already understand the concept of inheritance from
> application scripting. But I can say from experience that this is one subject
> where the honest explanation actually turns out to be far simpler and easier
> to understand that any 'helpfully fictionalised' version. Some knowledge is
> just better left 'untransferred'. :)
Okay, I'm convinced. (Not only by Hamish's argument/explanation here, but
also by some discussion with the original authors of AppleScript. Plus the
facts kind of speak for themselves.)
So for the second edition of the book, shall I just call this delegation
(and "the delegation chain") and throw in a note saying that the ASLG
wrongly calls it inheritance?
Now that I've asked the question, I have to say I'm 99% sure the answer
should be "yes". Plus it would mean I'd only be using the word "inherit"
with regard to the way a class's properties are listed in the dictionary,
thus getting rid of a big ambiguity. I hate when I use the same word in two
different senses in any book of mine.
Hamish, you'll certainly say that correct naming of parts is best. Paul, you
might feel wedded to the ASLG's terminology (although I do point out at
several places in the book that it's inadequate, I get a little nervous
departing from it because people are used to it). Any opinions from others
on the list? Are we all ready to start calling this the "delegation chain"?
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden