--001636c5b680138866046aba5565 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/5/25 Mike Stephens <rubfor / recitel.net> > Object Orientation is conceptually about a sea of objects interacting > with each other. They are all however in one sea. > > Earlier in Computer Science, we had stepwise refinement, which was a > tree-like view of application compartmentalisation. High level functions > would be split into lower level consituents and so on. > > I was thinking to model that in Ruby you would like to be able to > contain classes within other classes in a similar tree like format, and > what a shame that Ruby doesn't let you do that. > > But of course it does. However people don't talk about it. Hal Fulton in > his book The Ruby Way asks people to let him know if they can think of a > good use for this feature. > > Do you ever use this? Can you see a reason why it doesn't seem to be > favoured? I use classes as namespaces quite a lot. Typically, I will nest a class inside another if the inner class is used directly only by the outer class and not by other parts of the system. It's not a hard-and-fast rule but I find this to be a useful organisational feature. --001636c5b680138866046aba5565--