Interface Implementation Through Aggregation
It's very tedious, mechanical and error-prone to implement an interface where all its members just delegate the call to some field or property that also implements the interface. For these C# types: interface I { void M1(); void M2(); void M3(); } class C : I { public void M1() { /*...*/ } public void M2() { /*...*/ } public void M3() { /*...*/ } } To implement the interface I in another class that just delegates the implementation to C , all the delegating code has to be done manually: class D : I { I impl = new C(); public void M1() { impl.M1(); } public void M2() { impl.M2(); } public void M3() { impl.M3(); } } It's not a surprise, then, that a very common request to enhance C# is the ability to lean on the compiler to generate this delegating code. The idea is to have some kind of syntax like this to achieve the same result as above: // Warning: Invalid C# ahead class D : I { I impl = new C() implements I; } This has already been ...