Classes as Packages (was: Harvesting infrastructure)

Andreas.Raab at gmx.de Andreas.Raab at gmx.de
Sun Nov 17 23:23:32 UTC 2002


Hi Anthony,

> But your right that I'm putting too many roles into classes.  I would
> have no problem with having a separate module object that served as the
> namespace/package for several classes.  Then modules could represent
> subsystems and you can disregard my argument above.  But I would still
> keep automatic detection of prerequisites as I have described in
> previous posts, which means adding mulitple inheritance (to avoid class
> extensions) and selector binding to protocol/abstract class.

We don't even need that much for determining prerequisites automatically.
What's needed to figure out dependencies automatically is to give every method
and global variable binding a dedicated "home" that describes where it is
defined. This is crucial. Then, you can trivially figure out the prerequisites
for a class by going through the imported bindings (literals, superclass, and
pool vars) and see what is referenced where. BTW, this is entirely unrelated
to the notion of what the "home" actually represents - it could be anything.

I've actually done this and it works pretty darn well. The only serious
problem I had was a UI issue - namely how to specify what "home" a particular
method in a foreign class belongs to. And it really struck me when I saw how
well Avi had solved this problem in DVS.

Just as some food for thought for the rest of the gang involved in this
area: One of the things I did was replacing the "source pointer" in CMs with a
numeric ID of the "home" of that method and have source code management go
through the "home". While being somewhat inefficient in terms of memory (due to
the extra mapping of method -> source) it has the very nice property of being
able to manage source code independently of the rest of the system. You might
as well have source files per class (I did this) or per package (would work
nice for DVS) or whatever - it might even be compressed and then your source
code could come right out of an SAR file ;-) I actually did a "mixed"
management where code would either come from the repository (if unmodified) or from
the changes file (if modified).

Cheers,
  - Andreas

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!




More information about the Squeak-dev mailing list