The Design Patterns book sought to clarify our language yet it has this error. I'm seeking to clarify our language.
The Design Patterns book sought to clarify our language yet it has this error. I'm seeking to clarify our language.
Delegate. Verb: Entrust (a task or responsibility) to another person, typically one who is less senior than oneself: "he delegates routine tasks".
It's not hard to see how that would be analogous to a variety of situations in computing.
If you want a term to be more pure, think of something more creative.
Edit: That's not to take away from your point that the GoF actually cited Lieberman in their use of delegation. If they misunderstood his intention, sure raise that point.
So why not argue about people using "delegation" when they just mean "forwarding"?
Here's an excerpt from my take on the 2 characteristics of consultation (or what is typically called "delegation") in my book
---- The first is the connascence of method names between collaborating objects. Connascence refers to the point and type of coupling between objects where a change in one object requires a change in the other. Consultation occurs when the message recipient forwards a message to another object which handles the response to the same message. A calculator would receive a balance message and forward that message to an account which responds to balance. Rails’ implementation of delegate does include a caveat that the message might be prefixed before it is forwarded, but the implementation is still connascent by method name. The second aspect of consultation is that the message recipient makes no modifications to the algorithm for handling the response. ----
I wrote to Lieberman to ask his opinion and he sided with NOT introducing the "consultation" term. But his reason was not because our misguided understanding of delegation is correct, his reason was because we already have a name for this: forwarding. The quote above is from my argument about why I think it is valuable to use the term "consultation".
So did "inheritance" but it means something very specific in programming parlance.
The language doesn't need clarifying, because the term has a definition, which is perfectly clear. Through a quirk of history, this perfectly clear definition happens to be different than the other perfectly clear definition which preceded it. Due to this retcon, Leiberman's original definition ends up being incorrect. Wasn't the first time something like this happens, and it won't be the last. So it goes.
If his post persuades everyone and they start using it the way he wants them to, then language does work that way.