Separate Query from Modifier
From CSSEMediaWiki
(Difference between revisions)
m (Reverted edits by Ebybymic (Talk); changed back to last version by Warwick Irwin) |
|||
Line 5: | Line 5: | ||
''Create two methods, one for the query and for the modification.''" | ''Create two methods, one for the query and for the modification.''" | ||
− | + | ==See also== | |
[[Command query separation]] | [[Command query separation]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 03:22, 25 November 2010
Straight from Martin Fowler 1999:
"You have a method that returns a value and also changes the state of an object.
Create two methods, one for the query and for the modification."