Group method parameter or individual parameter?
- by Nassign
I would like to ask on method parameters design consideration. I am usually deciding between using individual variables as parameters versus grouping them to a class or dictionary as one parameter.
Is there such a rule when you should use individual parameter against using a class or a dictionary to group the parameter?
Individual parameter
- Straight forward, strongly typed
Dictionary parameter
- Very extensible, like HTTP request but cannot be strongly typed.
Class parameter
- Extensible by adding member to the class parameter, strongly typed.
I am looking for a design reference on when to use which?
Note: I am not sure if this question is valid in programmers but I definitely think it would be closed in stackoverflow, If it is still not valid, please point me to the proper page.