How to use PackageInfo (was: RE: About 3.6 alpha process: tobreak the less)

Avi Bryant avi at beta4.com
Wed Jun 4 20:02:56 UTC 2003


On Wed, 4 Jun 2003, Andreas Raab wrote:

> Okay, even if that's the stupid question of the day but how exactly does one
> use PackageInfo?

There's some documentation at
http://beta4.com/squeak/aubergines/docs/packageinfo.html .

If you've played with DVS, PackageInfo is what gives it is naming
conventions - ie, using '*refactory' to mark a method category as
containing class extensions for the refactoring browser.

If you follow these conventions, you can get a PackageInfo instance (eg,
with "PackageInfo named:  'Refactory'"), and send it messages like
#classes, #methods, #coreMethods, #extensionMethods, #externalSubclasses,
and so on to introspect on the package.

This info gets used by various exporters (for .cs, VW3, VW5 formats), DVS,
Monticello, MudPie, etc.

The naming conventions described in the document are just defaults, if you
need to you can override some aspects of them.  For example, Seaside has a
PackageInfo subclass (Seaside2Info) that overrides
#includesSystemCategory: to match anything with pattern 'Seaside/Foo-Bar',
rather than 'Seaside2-Foo-Bar' which would be the default.  When you ask
for (PackageInfo named:  'Seaside2'), it finds that Seaside2Info has
overriden #packageName to return 'Seaside2', and gives you an instance of
that instead of the base PackageInfo class.  So you can actually specify a
package in arbitrary ways if you like (though there's then no guarantee
that two packages won't claim the same piece of code).

Sorry if that message was scattered, I'm just running out the door...

Avi



More information about the Squeak-dev mailing list