Last Updated: February 25, 2016
· philipwheldon

Use Obsolete attribute when doing major re factor

Sometimes when doing a large re factor of a .Net code base which requires a change in method signature you can end up with a long chain of changes which can become overwhelming by simply changing the method signature and fixing tests and production code.

Instead of employing this approach, try marking the existing method with the Obsolete attribute and create a new method with the same name and the required signature. The tests and code can then be updated in a more incremental manner which I found decreased stress and led to more considered re factoring.