Introduce Parameter Object
From CSSEMediaWiki
Revision as of 04:06, 19 October 2010 by Jenny Harlow (Talk | contribs)
What to do when you have a group of parameters that naturally relate or fit together. This will help make parameter lists shorter and easier to understand (long parameter list smell) and will make it easier to modify if needed.
It can also help reduce Duplicate code smell by moving other behaviour to this new object
Example:
amountInvoicedIn(Date start, Date end)
becomes
amountInvoicedIn(DataRange range)
with DataRange becoming the new "Parameter Object"
See Also