in reply to Inheritance: the root of the problem
1. interface inheritance, saying you support every operation that your super supports. This is probably better accomplished with interfaces, either explicit (like Java) or implicit (does it support these methods? good enough.)
2. implementation inheritance, reusing the parent's implementation of various stuff because the same applies to you. This is can be done via delegation, where you create the parent object, and "merge" some or all of its methods into the "subclass" object you're creating. If there's a need for the parent to call into the child, then appropriate closures should be passed upwards during construction.
Making a nice syntax for all this is probably the biggest challenge :-)
UPDATE: You might also want to look at how the E programming language, which does closure-based OO, handles delegation.
|
---|