Classes as Packages (was: Harvesting infrastructure)

Anthony Hannan ajh18 at cornell.edu
Sun Nov 17 21:09:45 UTC 2002


Sorry Stephane, I should have elaborated more in response to your
subsystem argument.  Here it is:
	I agree packages are useful for conceptualizing subsystems, but I will
argue that classes can serve this role as well.  Consider the Compiler
class.  It is a class but it also represents a whole subsystem composed
of Scanner, Parser, all the parse nodes, etc.  These are the components
of a compiler and therefore are prerequisites.  In other words, not all
classes are equal.  Some are high level, some are low level.  The high
level classes can represent subsystems.
	In fact, I would organize classes into these levels instead of by equal
system categories.  Instead of having system categories and one system
dictionary, I would have classes hold other classes directly in their
class variables.  Higher level classes would hold lower level classes
that they may use.  The class themselves would replace system
categories.  And each class would represent its own namespace consisting
of its class vars plus all its inherited class vars.  Remember, I am
assuming multiple inheritance, so some classes can serve as pool
dictionaries and be inherited by any class that wants to use that pool. 
Common classes would be visible from Object via inherited pools so all
classes would have access to them.
	Anyway with classes we don't even need the concept of packages,
and a subsystem can be represented by a class, or a small set of classes.

Cheers,
Anthony



More information about the Squeak-dev mailing list