Classes as Packages (was: Harvesting infrastructure)

Avi Bryant avi at beta4.com
Sun Nov 17 23:48:08 UTC 2002


On Mon, 18 Nov 2002 Andreas.Raab at gmx.de wrote:

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

The recently released version of PackageInfo does pretty much this, in
reverse - PackageInfo>>browseExternalReferences will bring up a MessageSet
of all methods that depend on that package (based on referencing either
class literals of that package, or selectors implemented only by that
package).  I've been thinking of writing a tool for automatically carving
out the image that uses a greedy algorithm based on this - for each method
that depends on a package, would it increase or decrease the number of
external references by pulling the method into the package?  After a
number of iterations, my guess is that you'd end up with a fairly good
definition of the package (this is similar to what Anthony was describing,
but I believe the final lines need to be drawn by humans, not
algorithms - there's extra semantic content we can add through
categorization that automated dependencies cannot).

Avi




More information about the Squeak-dev mailing list