Classes as Packages (was: Harvesting infrastructure)

Andreas.Raab at gmx.de Andreas.Raab at gmx.de
Sun Nov 17 21:39:24 UTC 2002


Anthony,

> 	I agree packages are useful for conceptualizing subsystems, but I will
> argue that classes can serve this role as well.

Sometimes they can, but (I think) only if they present a facade which hides
the intrinsic complexities of the stuff behind it. This is true for the
compiler and some other subsystems but nor for all of them. Best example:
Collections.

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

*Way* too much complexity in a single place for my taste. By the end of that
scheme you would have lots of distinctive responsibilities merged into a
single place - namely that of being a class (describing instance behavior), that
of being a "utility belt" for methods(those two already get really
confusing) and then also being a package and being a name space. Without a way of
getting a clear understanding what is what the result will be utter chaos. And it
doesn't even solve any of the packaging problems.

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

And some classes can probably serve as coffee machines, and some as hair
dryers ;-)

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

And with objects we don't even need classes. That's not the point. The
concept of packages is simply a useful one - similar to that of having classes.

Besides, I think that even if that scheme could be implemented (which I have
strong doubts about) I don't think very many people could grok it. Might be
worthwhile to consider.

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