Pass a object that hold you parameters then pass that object to function.
Avoid longlist parameters use Object or array of parameters
Advantage
Consider you used longlist function on three place and you want to add more 1 then in this case you need to modify code at three places .
If you use object or array then once place change is required.
https://stackoverflow.com/questions/2432443/best-practice-for-passing-many-arguments-to-method
https://stackoverflow.com/questions/36904955/passing-single-object-vs-passing-multiple-parameters
No comments:
Post a Comment