4 ms·
I'm willing to try it out. I usually get around the cited issues through dependency injection into the model. That is, instead of placing large amounts of log
by ap22213 14y ago
I'm willing to try it out.
I usually get around the cited issues through dependency injection into the model. That is, instead of placing large amounts of logic in the controller, I let the model hold the logic.
In a naive implementation, this may couple the model to things it shouldn't be coupled to. So, to avoid the model coupling to infrastructure resources (say, storage), I let the controller inject those objects into the model, as needed.
But, I realize that that's an architect-y, OO kind of way to do it that requires some background knowledge which can may obfuscate the code. So, I'm all about making things easier for everyone.
As others have mentioned, it'd be useful to have a more sophisticated example.