1

Resharper can create Delegating Members (Alt + Ins)

But what are delegating members?

Most of the searches I do come up with American Politics which is not useful.

Dan
  • 12,808
  • 7
  • 45
  • 54
  • 1
    This SO-Answer explains it: [distinguishing between delegation, composition and aggregation][1] [1]: http://stackoverflow.com/questions/1384426/distinguishing-between-delegation-composition-and-aggregation-java-oo-design – Noffls Mar 21 '13 at 11:16
  • That explained it well. Thanks. – Dan Mar 21 '13 at 13:53

1 Answers1

6

Delegating methods are simply methods that tunnel directly through to some contained object.

For instance:

class MyClass
{
    private SomeType innerObj = new SomeType();
    public Bar GetFoo()
    {
        return innerObj.GetFoo();
    }

}
spender
  • 117,338
  • 33
  • 229
  • 351
  • Oh my god. Just thinking about the wasted hours setting up proxys makes me wish I had known this earlier – Dan Mar 21 '13 at 13:51
  • Yep. A real life saver if you need to make proxies, facades and the like. – spender Mar 21 '13 at 13:54