A function is no longer required for the function ontology.Remove this parameter.
Motivation:ProgramMembers may check the added parameters but are often reluctant to remove them. Their wishful thinking is: in any case, redundant parameters will not cause any problems and may be used in the future.
Parameters represent the information required by the function. Different parameter values have different meanings. Function Callers must worry about what to upload for each parameter. If you do not remove unnecessary parameters, you will be charged for each user. It is not cost-effective, not to mention "Removing Parameters" is a very simple refactoring.
However, for Polymorphism functions, the situation is different. In this case, another implementation of the multi-state function may use this parameter, so you cannot remove it. You can add an independent function to use in these cases. However, you should first check whether the caller uses this function to determine whether it is worth doing so. If some callers already know that they are processing a specific subclass and have done additional work to find out the parameters they need, or they have used their understanding of the class system to avoid getting null, it is worthwhile to create a new function to remove unnecessary parameters. If the caller does not need to know the class to which the function belongs, you can continue to maintain the ignorance and happiness of the caller.
Method: 1. Check whether the function signature has been implemented by a superclass or subclass. If yes, perform the following steps for each implementation.
2Declare a new function with the same name as the original function, but add new parameters. ConvertCodeCopy to the new function.
3, Compile.
4Modify the old function to call the new function.
5, Compilation, and testing.
6Find all reference points of the function. Modify all of them to reference the new function. After each modification, compile the test.
7And delete old functions.
8, Compilation, and testing.