[Pythonmac-SIG] Re: improving appscript architecture
Jack Jansen
Jack.Jansen at cwi.nl
Thu Jul 15 22:43:32 CEST 2004
I won't quote everything, but I have a couple of suggestions. Let me
start by stating that I like the architecture you sketch very much.
Next, the suggestions:-)
Actually, there's really only one suggestion: think of a naming scheme
that automatically shows which part belongs where.
For example, if you name the lowlevel stuff aecodecs, aeclient and
aeserver and don't reuse the "ae" prefix it's clear that they belong
together and what they do. Then the next level up you have objcodecs
(your objspec) which now does an obvious thing. Incidentally, his
leaves the names "objclient" and "objserver" free for client and
server engines that handle objspec routing, if ever you want this. An
alternative naming scheme would be to push your objspec down one level
and call it aeobjspec. aecodecs would then have some simple hooks to
plug in to this.
osaterms is clearly on the next level up, but I think I would suggest
splitting the internal representation (osaterms) and the parser
(osaparser? osaaeteparser?): there are already three ways to store
terminology information in an application, separating this should make
life easier.
But what else is on this level, and how to couple the information from
osaterms to the lower layers, isn't completely clear to me. And, as the
amount of handwaving in your message also increases at this stage I
think I'm not alone here. This coupling is exactly what causes the
interdependencies in the old architecture. I'm tempted to think that
metaclasses may hold the answer here, but I'm not sure (being too old
to ever truly understand metaclasses:-).
Something along the lines of there being metaclasses for osaobjspec,
osaclient and osaserver that look at the osaterms for the class and do
the right thing.
The dependencies are now all within one level and downwards, I think:
if aeclient gets a reply with an objspec it will pass it up to
objclient, which can use objcodec to decode it to the
"app.elems('docu').byindex(1).prop('ctxt')" form, which it passes up to
osaclient, which can use osaobjspec to turn it into a form applicable
to the application in question.
The remaining difficult questions (such as how to represent "whose"
clauses) now appear to be the responsibility of one module only
(osaobjspec, in case of whose).
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
Goldman
More information about the Pythonmac-SIG
mailing list