• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inheritance and Loaded Libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inheritance and Loaded Libraries


  • Subject: Re: Inheritance and Loaded Libraries
  • From: has <email@hidden>
  • Date: Tue, 2 Nov 2004 13:31:31 +0000

Christopher Nebel wrote:

> 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.

For what it's worth, the authors of Self refer to these as "class-based inheritance" and "prototype-based inheritance", respectively. (See <http://research.sun.com/self/papers/self-power.html>.) I'm not sure if those terms are considered standard, but Self is one of the first languages to use prototypes exclusively, so there you are.

Noted. Though the ASLG doesn't say "prototype-based inheritance", just "inheritance", which is not the same thing. The word "inheritance" is used to describe both the mechanism and the purpose to which it's used, composing behaviour to define new types of objects. The ASLG doesn't indicate it's using it only to refer to the latter (it doesn't mention prototypes at all), hence it's misleading. e.g. It caused me a lot of confusion initially when learning OOP as I was reading up on both AppleScript and Self and traditional class-based languages, and it took a while to figure out that the same word was being used to describe equivalent usage via two completely different mechanisms.


FWIW, I suspect the Self authors used "prototype-based inheritance" as a form of shorthand to distinguish between using delegation to extend objects' behaviour through composition and using it for other tasks, e.g. to implement the Chain of Responsibility design pattern (very common in NewtonScript, for example). Certainly, it trips off the tongue better than "behavioural composition through delegation" does:), but the word "inheritance" has such strong connotations that proper context is essential to prevent confusion.

Cheers,

has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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


  • Prev by Date: Re: Trouble Getting Into AppleScript
  • Next by Date: Re: Best practices- nested loops or handlers or both
  • Previous by thread: Re: Inheritance and Loaded Libraries
  • Next by thread: Re: Inheritance and Loaded Libraries
  • Index(es):
    • Date
    • Thread