Re: Handlers and Tell Blocks
Re: Handlers and Tell Blocks
- Subject: Re: Handlers and Tell Blocks
- From: has <email@hidden>
- Date: Thu, 29 Aug 2002 16:24:08 +0100
Paul Skinner wrote:
>
> One option if you're communicating heavily with one particular object,
>
> and don't want to use explicit tell blocks all the time, is to take that
>
> object as the parent property for your script [object]:
>
>
>
> property parent application : "Microsoft Entourage"
>
>
Holy code! Has suggests using the parent property!
Funny man. :p
It's all a matter of semantics: using the parent property to pull a
general-purpose module into the namespace of a script which needs to call
its functions [1] is not that same thing as using the parent property in
creating a new, more specialised object that extends the behaviour of an
existing, less specialised one [2].
So I'm being entirely consistent you see, even though I didn't actually
bother to explain how.:p As such, you may consider me somewhat
irresponsible for throwing the loaded gun into the arena without first
explaining which end to point where, but when did I ever care for the oft
ugly consequences of my thoughtless actions? <ducks as stray bullet buzzes
past> ;)
>
The use of 'object' there might be a bit broad. Applications only need
>
apply.
Application objects and script objects may also usefully apply.
Now, while it's true that any object at all may be taken as a parent, in
practice you're unlikely to find many uses for subclassed integers or
strings. Even subclassing lists, dates, etc. isn't that useful: you end up
losing some of the functionality of the original type and there's no way to
replace it seamlessly, unfortunately. [3]
Cheers,
has
[1] (I assume you're referring to the modules thread that Steve and I were
debating on the other day.:)
[2] Which is the sort of thing you do all the time in OOD. What fun!
[3] AS's OO featureset is relatively light compared to other OO languages.
Fuzzy notion of classes, no concept of privacy, no way to override built-in
operators, no destructors, no singletons, etc. None of this stuff's
essential to OOP, mind, but it does make it much nicer to do. But most
ASers never do OOP anyhow, so I can't blame the AS team or anyone else for
wanting to invest their energies more productively elsewhere.
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.