Modules and class... [ a off-topic question ?]

David Simmons David.Simmons at smallscript.com
Thu Feb 28 01:10:02 UTC 2002


Here are some more [deep] questions...

Does a class define a type (or not)?

What is "type"? 

How is "structure" distinguished from "behavior"?

Are they one and the same thing w.r.t. a "type" or a
"class-specification"?

====

Does a class define a namespace (or not)?

If not, then how does one specify what namespace scope(s)/things a
classes methods, or its instances method, can access?

Where are those (namespace elements) things defined?

How does one meta-object protocol extensibility for supporting different
types of "namespaces"? 

I.e., if the answer is not in classes then the design is the result of
not thinking in pure OO terms and reflection/meta-object protocol.

====

Does a module specify ownership (or not)? 

Is a module fundamentally a unit of packaging and deployment (or not)?

Is "namespace" a role/protocol/behavior/interface/api, or an object
type?

What is the distinction between an "interface", a "class", a "behavior"?

When you think about these ideas in terms of specific objects (or
classes) of objects, you're not thinking in OO terms. Behavior (the
message semantics an object understands/responds-to) are all that
matters here. 

We can formalize these into "interfaces" (or protocol api's if you
like). Any object which supports a given interface/protocol should be
able to perform in the "role" defined by that "interface/protocol".

In considering these design issues it is important to view the system
from the meta-object protocol level, not the object-procotol level. 

I.e., think in terms of the object-model as defined by the meta-system.
Where we are describing/talking-about the structure of the meta-system
and its facilities.

-- Dave S. [SmallScript Corp]

SmallScript for the AOS & .NET Platforms
David.Simmons at SmallScript.com | http://www.smallscript.org


> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org [mailto:squeak-dev-
> admin at lists.squeakfoundation.org] On Behalf Of Lex Spoon
> Sent: Wednesday, February 27, 2002 7:10 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: RE: Modules and class... [ a off-topic question ?]
> 
> 
> 
> > > I think my intuitive decomposition of classes and modules may be
> > similar
> > > to others', so let me toss it out.
> > >
> > > A class primarily declares a number of instance variables, and
holds a
> > > number of methods, and can be instantiated.  It can also define
> > > variables in a local scope, but that's secondary and not even
> > necessary
> > > if we have modules.
> >
> > You've described a constructor, not a class.
> 
> Does a constructor include a specific definition of instance variable
> layouts, and a specific set of methods?
> 
> 
> 
> > > A module primarily defines variables in a local scope.
Theoretically,
> > > it could have instance variables, could have methods, and could
even
> > > allow instantiation.  These abilities are not only secondary, but
> > might
> > > not be necessary at all.
> >
> > You've described a namespace, not a module.
> 
> A namespace is one of the most important parts of a module.  Another
> important part is dependency information, which normally wouldn't be
> included in an individual class (you could, but it would seem like
quite
> a burden!).  What aspect of modules have I left out, that you consider
> important?
> 
> Overall, these descriptions seemed pretty obvious to me.  If you are
> using different terminology, that would probably explain a lot of the
> apparent disagreement in the modules discussions here.
> 
> 
> 
> -Lex





More information about the Squeak-dev mailing list