Re: applescript and graphics programs
Re: applescript and graphics programs
- Subject: Re: applescript and graphics programs
- From: has <email@hidden>
- Date: Wed, 12 Jun 2002 00:38:37 +0100
Erik Price wrote:
>
But again, the fact that I know nothing of how OO programming in
>
AS works is probably leading me to think I can do things I can't do.
Whether an OO or procedural design is more appropriate really depends on
the sort of problem you're trying to solve. (And, I suppose, how
comfortable you are with OOD/OOP in the first place.) OOD/OOP is overkill
for simple tasks, but can be a major advantage in big, complicated ones.
Purist concerns aside, it's perfectly possible to mix the two techniques as
well, if that's what suits best.
Although built-in object types and application object models use a
class-based system [1], OO Programming in AS follows a prototype-based
model [2]. So if you're coming from Python and Java, you'll find OOP in AS
a little different. There's a lack of OOP teaching materials for AS, so you
might want to look at another prototype-based language such as JavaScript
to grok the concept, then use the ASLG to work out the appropriate syntax.
[3]
AS lacks some niceties such as privacy [tip: use a good naming scheme], and
seems to have some problems storing very big, complex object structures to
disk, but it has the essentials and generally works well enough. There's
also some nifty things can be done with inheritance, thanks to the
different implementation.
HTH
has
[1] two-tier system - a class definition is a blueprint, set down at
compile-time, by which objects [instances of that class] can later be
manufactured during runtime
[2] single-tier system (more flexible) - create objects directly whenever
you like, i.e. compile- *and/or* run-time
[3] If you also want to dredge the list archives for posts by Scott Norton,
you'll find some very useful AS OOP info. While you're at it, there's also
some OO related posts I've made in the last couple months. Plus some of the
scripts on my site (e.g. stackLib) are OO in part or in full (a fair bit of
crappy stuff too, so please ignore any rubbish you find).
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta 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.