3 ms·
> If object X has 9 methods I want to reuse in object Y, making X a component of Y still requires me to re-implement those 9 methods in Y, even if they are just
by couchand 7y ago
> If object X has 9 methods I want to reuse in object Y, making X a component of Y still requires me to re-implement those 9 methods in Y, even if they are just pass-throughs.
That is also not universal. In Ruby, for instance, one can write:
class Y
def method_missing(m, *args, &block)
@x.send(m, *args, &block)
end
end
- smrq 7y agoI don't think you have to squint very hard to see that as an implementation of inheritance.