I need to process about 20 POST parameters, and I'm not sure where to do it.
I could define each as an argument to a method on the model and pass them from the controller when the method was called. This will lead to pretty little work and make the function call less clear due to the number of arguments.
Or I could call the method on the model and just access the parameters.
Passing parameters as arguments will give me more control over the parameters accessed by the function, and the documentation will be more understandable. But if new parameters were added later, they will need to be added to the end of the method call so as not to interrupt every existing call. I assume this will become rather confusing if this happens several times, since the arguments cannot be logically grouped.
If I refer to a parameter in the model, the parameters should not be passed from the controller to the model, which makes the call method a term. But I do not control the parameters that are accessed, since they can easily be added or deleted without restrictions. This will require more discipline from other developers, and I don’t like to depend on it, because sooner or later someone must "just (add | change | fix) this real speed."
I'm not sure where to go. I usually do all this in a model, since it is faster to write, it seems to be easier to maintain (without chaos of arguments) and is conceptually better suited for my understanding of the model. On the other hand, I’m not sure that my idea of the model is correct, and if it ends in chaos, if I depend on other developers, to always update the documentation after each change.
So what should I do?
source
share