Introduce Parameter Object
From CSSEMediaWiki
Revision as of 10:53, 14 October 2009 by Brett Ward (Talk | contribs)
What to do when you have a group of parameters that naturally relate or fit together. This will help make parameter lists easier to understand 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