The Gang of Four Got Delegation Wrong (and so did everyone else)

2025-03-26

This article challenges the common understanding of delegation as presented in the Gang of Four's *Design Patterns* and various Ruby libraries. The author argues that many examples cited as 'delegation' are simply message forwarding, not true delegation. True delegation, as defined by Henry Lieberman, requires that 'self' always refers to the original message recipient throughout the delegation process. Using JavaScript and Ruby examples, the article clarifies the correct meaning of delegation, highlighting the widespread misunderstanding caused by incorrectly labeling message forwarding as delegation. The author urges developers to understand the true meaning of delegation to write cleaner, more maintainable code.

Development Delegation