SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Refactoring: Extract Parameter

Source

refactoring to patterns, p. 346

Mechanic alternative

  1. extract local variable on the variable that should be a parameter
  2. move the variable initialization to the start of the method
  3. extract a method on the rest of the method (all but the variable initialization) with the same name as the old method
  4. inline the old method

I think the mechanics in RtP are better, because only two steps are required. What I like about the sequence here is that it visualizes how the code moves.

research/cultivate/extractparameter.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019