On 20/12/2010 10:21, Robert Matthews wrote:
At the moment I can't think of any reasons not to get rid of the array
parameters, but the replacements should be a var-arg or a List. In
particular var-arg should be used when you would have had a reference
parameter if there was only one instance, eg if all methods invoked
reflectively only had one parameter.
Fine with this.
So to summarize:
- where we currently have a method that receives an array representing
parameters, this should be replaced at least by a varargs, and possibly
overloaded to also accept a List
- where we currently have a method that receives either an array
representing some other structure, or receives more than one array, then
it should be replaced with a List
- where we have a method returning an array, this should be replaced by
a list (preferably immutable, but the Javadoc should indicate)
Thx
Dan
Regards
Rob