Talk:Delegation (object-oriented programming)
Additional cross reference
I don't see a link on this page to Observer pattern. I'm new to this stuff, but aren't these two topics intrinsically related? Kmote (talk) 22:10, 15 December 2008 (UTC)
Old definition
Shouldn't the old definition go under the modern one? Most people don't read more than one page, which would mean only the old definition is read. - September 26th 2005
- Good point. Wouter Lievens 10:20, 26 September 2005 (UTC)
Third Definition
The third definition, as given in [Taivalsaari, 1996] is missing. Shall I add it? Wouter Lievens 19:37, 1 May 2005 (UTC)
- Now that I think of it, the definition is equivalent. Wouter Lievens 14:35, 11 May 2005 (UTC)
Language Feature example wrong?
I don't get this. If a in class B were a usual field, this in A::foo() would refer to the a object, so you'd get "a.bar" printed. With the delegation language feature, it should be "b.bar", since this still refers to object b. Giese 09:37, 27 September 2006 (UTC)
- Giese, even though no-one has responded to your concern in nearly 3 years, I think you are right. When b.foo is called, (class A).bar should start lookup (Smalltalk style) at b.bar which is B.bar, and thus print("b.bar")
- Was the example changed between 2006 and today?
- I may be wrong, but my first impression is that the Java/C# example contradicts the text. If I understand correctly, the text insists that the method binding is done at run time, but the example appears to bind class B (the lookup of B.foo) to class A (looking up A.bar) at compile time. Have I misunderstood the Java/C# pseudocode? Could the article be expanded a little to explain how the program can delegate B.foo to different methods (such as C.foo and D.foo) depending on a run time delegation link, depending on the class/state of a when new B(a) is called) at run time? --Hroðulf (or Hrothulf) (Talk) 08:22, 29 June 2009 (UTC)
Hard to understand
This page needs some cleanup work to make it easier to read. I can't understand half of what its talking about. This should be readable to people who have never heard of a delegate. Fresheneesz 00:18, 22 November 2006 (UTC)
Merge with Delegation pattern
This article talks at length about the Delegation pattern, yet Delegation pattern already has its own node. Shouldn't they be merged? --Devnevyn 12:45, 11 August 2007 (UTC)
I second this. This page is not very clear to me even as one who already understands its subject. 76.187.248.215 (talk) 09:07, 15 July 2008 (UTC)
Merging with Delegate (.NET)
I am removing the merge proposal, as a delegate object as per .NET terminology is deeply different from the Delegation design pattern presented here. - 62.101.126.215 (talk) 16:08, 21 January 2008 (UTC)