Isolated projects as modules

Chris Reuter cgreuter at csclub.uwaterloo.ca
Sun May 9 19:53:33 UTC 2004


So I took a look at the recent Squeak 3.7 beta (nice icons!)  after
having used 3.4 for a while and have stumbled on the concept of
isolated projects.  This is a really neat idea.

I'm wondering if this could be extended into a kind of airtight
namespace, something analogous to libraries in C or modules in
Modula-2.  This would let many developers work on different parts of
the same project, mostly in isolation, without accidentally stepping
on each others' toes.  

The only way to interact with another project would be to explicitly
switch to another project.  For example:

	result := [RayTracer render: data] 
				inProject: #RayTracer value: dataSet.

(If you wanted something more formal, you could always write a proxy
class that implements a public interface by doing something like the
above.)

I'm starting to think that something like this will be necessary
because it's good Smalltalk style to extend system classes as
necessary but that practice tends to clash with others' code.  I'd
like to have something that gives me the safety of a library mechanism
without cramping my coding style.

My take on the semantics:

	1) New classes, instance variable names, globals and methods all
belong to their project.  (I'm not sure what to do about pool
dictionaries.  Do people still use them?)

	2) Projects are nestable.  Thus, if project OfficeSuite contains
project WordProcessor, all of the contents of OfficeSuite are visible
inside WordProcessor, but not the converse.

	3) The current project is tied to the current context.  New
contexts take their project ID from the previous context but this may
be explicitly changed.

Implementing this is non-trivial, but it's been rattling around my
head for a while so I thought I'd share, given that I'm posting to the
list again anyway.


                              --Chris


-- 
Chris Reuter                                                 http://www.blit.ca
"Of course, some of us still are [swinging from trees], but that portion of us
 isn't heavily represented on Slashdot. Er...appearances to the contrary
 notwithstanding."         --Larry Wall (in a Slashdot interview)



More information about the Squeak-dev mailing list