Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Smell Long Parameter List
Anti-pattern indicating need for refactoring
Tags
refactoring-fowlercode-smellmaintainability
Impact
Long parameter lists are hard to understand, become inconsistent and difficult to use, and you are forever changing them as you need more data. With objects you don't pass in everything the method needs; instead you pass enough so that the method can get to everything it needs.
Symptoms
- Methods with many parameters
- Parameters that could be obtained from objects you already have
- Multiple data items that should be an object
Source
Martin Fowler — Refactoring: Improving the Design of Existing Code, 1st Edition (1999)