Shotgun surgery smell
From CSSEMediaWiki
(Difference between revisions)
RobertLechte (Talk | contribs) (New page: "Shotgun Surgery" refers to a change to one piece of code resulting in the need to change many other pieces of code. For instance, if you change the format of your XML, this should require...) |
m (Reverted edits by Ebybymic (Talk); changed back to last version by Matthew Harward) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
"Shotgun Surgery" refers to a change to one piece of code resulting in the need to change many other pieces of code. For instance, if you change the format of your XML, this should require only one change to the code (in the parser). If you need to change the code in several places, then you're probably not abstracting/layering your parsing code properly, and you need to strongly consider refactoring. | "Shotgun Surgery" refers to a change to one piece of code resulting in the need to change many other pieces of code. For instance, if you change the format of your XML, this should require only one change to the code (in the parser). If you need to change the code in several places, then you're probably not abstracting/layering your parsing code properly, and you need to strongly consider refactoring. | ||
+ | |||
+ | This contrasts with the [[Divergent change smell]], where many unrelated changes take place in a single class. | ||
+ | |||
+ | == See also == | ||
+ | * [[Code smells]] | ||
+ | |||
+ | {{Template:CodeSmells}} | ||
+ | |||
+ | [[Category:Code smells]] |
Latest revision as of 03:07, 25 November 2010
"Shotgun Surgery" refers to a change to one piece of code resulting in the need to change many other pieces of code. For instance, if you change the format of your XML, this should require only one change to the code (in the parser). If you need to change the code in several places, then you're probably not abstracting/layering your parsing code properly, and you need to strongly consider refactoring.
This contrasts with the Divergent change smell, where many unrelated changes take place in a single class.
See also