On Saturday 28 July 2001 10:29 am, Nat Pryce wrote:

> A rule of thumb is to avoid cyclic dependencies between classes and never
> have cyclic dependencies between packages (Ruby files and modules), which
> means no cyclic dependencies between classes in different modules. 

The part about "in different modules" is important here. Since in most 
dynamic languages we can extend a class in a different package, it's quite 
possible to create a cyclic dependency between classes in a single package 
without causing a cyclic dependency between packages.

It's interesting to note that the authors of UML (Booch and Rumbaugh, 
anyway), being strictly C++ guys, didn't understand the idea of class 
extension. I had lunch with Jim Rumbaugh at OOPSLA '97 and explained this to 
him (from a Smalltalk point of view); he'd never heard of such a thing. 
Neither had Grady Booch. Years later, I note that UML still doesn't include 
this concept.

It's sad to see a potentially useful concept like this ignored by a popular 
modeling language.

>  Despite the title, The book Large Scale C++ Design by John Lakos has some
> good guidelines for organising modules and classes that are applicable to
> Ruby programming.

Except, of course, for the parts about packaging that don't consider the 
ability to extend existing classes from different packages. Robert Martin's 
OO books also ignore this, being C++-centric. I haven't seen this topic 
covered well by any of the OO book authors (many of whom are writing from a 
C++/Java point of view). Maybe _Mastering Envy/Developer_ has something to 
say on this.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned / bike-nomad.com
homepage:  http://bike-nomad.com