Structures VS INPUT PARAMETERS

¿Qué es mejor, usar 10 parámetros de entrada en Server Action o usar una estructura con 10 parámetros?

Solution

Hi Jose,

Let's define better in sense of code quality, reusability and performance.

There is a best practice rule that is performed in tools like Architectural dashboard, Omnext, and Boncode that validates this. A lot of input parameters are a sign of code complexity. Moving the parameters to a structure does not make the code complexity less. As such moving 10 individuals parameters to a structure are not improving anything.

From a code-reuse perspective, if you use the same set of parameters multiple times, it does make sense to use a structure for input or output parameters, even for local parameters.

Using individual parameters or structures should have no impact on performance.

Regards,

Daniel


Solution