I have a method that I want to expand (rather than writing a new method which does basically the same thing), by adding an unknown number of parameters to the end of the list of parameters.
If I do this, will I have to change all the calls to the method? I guess the question is, does the unknown parameter include the case there being no parameter passed in at all?
For instance, if I have a method:
queryFactory(int [] typeArgs, int queryType, int[] ... args){}
Could I call:
queryFactory(typeArgsInstce, queryTypeInstce)
And then when I need to add parameters to the query call:
queryFactory(typeArgsInstce, queryTypeInstce, argsInstce)
Where argsInstce
is an array of integers containing extra arguments.
I would like to just edit this method rather than writing a new one which does almost the exact same thing except it has some arguments to add to queries. I will simply write another method if by editing this one I will have to change every other call to this method.