I
Its Me
I've been wondering what fine-grained module structure (like Enumerable)
would make sense for collections, and just came across this work where the
Smalltalk collections were refactored using somthing they called Traits (for
all practical purposes, these are like Ruby modules).
http://www.iam.unibe.ch/~scg/Archive/Papers/Blac02aTraitsHierarchy.pdf
There were some very useful ideas in this re-factoring. e.g.
module TEmptiness
#requires "size"
def isEmpty () ...
def notEmpty () ...
def ifEmpty (&block)
def ifNotEmpty (&block)
etc.
end
Beyond this, there are many other candidates for module-like refactoring
e.g. see Larch traits http://www.cs.iastate.edu/~leavens/Handbooks.html.
Any thoughts on the benefits / possibility of using some ideas from here to
provide more fine-grained modules in Ruby libraries?
Cheers ....
would make sense for collections, and just came across this work where the
Smalltalk collections were refactored using somthing they called Traits (for
all practical purposes, these are like Ruby modules).
http://www.iam.unibe.ch/~scg/Archive/Papers/Blac02aTraitsHierarchy.pdf
There were some very useful ideas in this re-factoring. e.g.
module TEmptiness
#requires "size"
def isEmpty () ...
def notEmpty () ...
def ifEmpty (&block)
def ifNotEmpty (&block)
etc.
end
Beyond this, there are many other candidates for module-like refactoring
e.g. see Larch traits http://www.cs.iastate.edu/~leavens/Handbooks.html.
Any thoughts on the benefits / possibility of using some ideas from here to
provide more fine-grained modules in Ruby libraries?
Cheers ....