Just In Time ReuseYou didn't fall prey to PrematureGeneralization; you didn't try to write reusable code ahead of time. When you're about to perform CopyAndPasteProgramming, then you cut it, paste it into a reusable module (class, function, method, whatever), and call it from both the old code (replacing the code you just cut) and the new (where you were about to paste it).
(Consider this a placeholder for a real pattern. Please feel free to replace it. Comments, suggestions, additions greatly appreciated. --PaulChisholm)
Inspired by PrematureGeneralization. See also CodeHarvesting.
In ExtremeProgramming we call this SwitchingHats?. You have to add some functionality:
EditText of this page
(last edited June 8, 2004)
or FindPage with title or text search