Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!news.msfc.nasa.gov!elroy.jpl.nasa.gov!lll-winken.llnl.gov!uwm.edu!spool.mu.edu!munnari.OZ.AU!news.hawaii.edu!phinely
From: phinely@Hawaii.Edu (Peter Hinely)
Subject: Re: Granularity of Modules?
X-Nntp-Posting-Host: uhunix4.its.hawaii.edu
Message-ID: <Dq0nA3.rD@news.hawaii.edu>
Sender: news@news.hawaii.edu
Organization: University of Hawaii
References: <page-1604961344560001@page.vip.best.com>
Date: Wed, 17 Apr 1996 17:01:15 GMT
Lines: 57

In article <page-1604961344560001@page.vip.best.com>,
Chris Page <page@best.com> wrote:
>What is the intended granularity of Dylan modules? Should I create a
>separate module for every class, or small group of classes, in order to
>provide fine-grain access control with respect to accessor functions,
>generic functions, constants, etc.?
>
>How does this relate to the C++ public, private, and protected keywords?
>Using these keywords, C++ has the ability to hide data and function
>members even from subclasses. The only way I can see to do this in Dylan
>is by creating a separate module for each class.
>

Hi,

Chapter 18 of the Apple Dylan TR "Programming in Apple Dylan" manual is 
devoted to explaining Dylan's modules and libraries.  The following is an 
excerpt from the introduction to that chapter:

Modules
-------
* A module is a namespace for variables
* Modules in your source code create different runtime environments in 
  your development environment
* A module can export variables for other modules to use
* A module can import variables exported by other modules
* You can create subclasses in a module of classes imported from another 
  modules
* You can also add methods in a module to generic functions imported from 
  another module


Libraries
--------
* Libraries are collections of modules;  they are separte units of 
  compilation and optimization
* Libraries can import and export modules (that is, the variables defined 
  in those modules).


Dynamism
--------
* Class dynamism allows you to specify whether a class can be subclassed 
  outside its library
* Function dynamism allows you to specify whether methods can be added to 
  a generic function outside of its library


Hopefully someone will answer your question better than I can. I would say
that besides being a namespace for variables, and a module is a unit of
organization.  You have to explicitly export the variables that you want
to be accessible from other modules.  Another module can then import all
the variables you exported from the first module, or selectively import
(and even rename) the variables you exported from the first module. 
Circular references are not allowed amongst modules, so that will affect
your organization. 

