Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Smell Message Chains
Anti-pattern indicating need for refactoring
Tags
refactoring-fowlercode-smellmaintainability
Impact
A client asks one object for another object, which the client then asks for yet another object, and so on. Navigating this way means the client is coupled to the structure of the navigation.
Symptoms
- Long line of getThis methods
- Sequence of temporary variables holding intermediate objects
- Client coupled to navigation structure
Source
Martin Fowler — Refactoring: Improving the Design of Existing Code, 1st Edition (1999)