Step 1: instead of passing everything as separate arguments, group the arguments into a class, say, X.
Step 2: Add getters to class X to get the relevant information. The caller must use getters to retrieve information instead of relying on parameters.
Step 3: Create an interface class that inherits class X. Put all the getters in the interface (in C ++, it's like pure virtual methods).
Step 4: Make the called methods only interface dependent.
source share