On Thursday, 16 August 2012 at 20:19:27 UTC, R Grocott wrote:
That sounds clean in theory - but so does Pimpl, and I know
from experience that Pimpl tends to make a horrible mess out of
any codebase. It doesn't help that, as far as I know, COM is
Windows-only, and D doesn't natively support the
method-defaulting system you described.
In practice, I think that proper interoperability w/r/t classes
and inheritance will tend be cleaner than coding strictly
against an interface. This can be demonstrated by choosing any
base-class derived-class pair, from any OO codebase, and
attempting to rewrite that parent-child relationship as a
server-client one.
What you ask for sounds quite similar to COM composition with
delegation.
If the problem is just fields and vtable shifts, D interfaces
should work too. Though there's no easy way for composition and
delegation with interfaces in D AFAIK. This already led to the
null_t hack, but the problem wasn't really solved.