Having one request object as a Method Signature parameter, which constitute all the required parameters

后端 未结 3 950
温柔的废话
温柔的废话 2021-01-19 04:31

A method signature is part of the method declaration. It is the combination of the method name and the parameter list.

So instead of specifying a list of parameters

3条回答
  •  囚心锁ツ
    2021-01-19 05:17

    If there's only 2 parameters, leave it alone. Object parameter may cause complex, maybe you even need defensive copy for object parameter.

    On other hand, most programmer couldn't remember parameters more than 3, if there are same data types in parameters, it's worse and error prone for programmers. In this case, using object parameter is good idea.

提交回复
热议问题