On 12 Nov 2002 at 7:47, dblack / candle.superlink.net wrote:

> (...)
> I agree that stylistically it does feel a little weird for a class to
> include the module in which it itself is defined.  The best thing
> would probably be to do a little design tweaking:
> 
>   module Foo
>     module FooMod
>       def thingy
>         puts "Hi, I'm here"
>       end
>     end
> 
>     class Bar
>       include FooMod
>     end
>   end
> 
>   Foo::Bar.new.thingy   # Hi, I'm here
> 
> Here, Foo::Bar is on the same level as the module it includes, which
> probably has a better feel to it.

I like this. Module Foo is used as a namespace, module FooMod is used 
as a mixin. A clear separation of concerns. Little design tweaking, 
big effect.

Regards,
Pit