3 ms·
I still haven't found anything that makes a clear distinction between "controller" and "model". The best explanation I've ever heard is that a controller's job
by tabtab 7y ago
I still haven't found anything that makes a clear distinction between "controller" and "model". The best explanation I've ever heard is that a controller's job is to map UI activity to the proper model and view. That's a start, but there is a lot of grey area there also as determining such can sometimes be complex in itself, which leaves the door open to "fat" controllers.
- johnmaguire2013 7y agoI think the biggest distinction to me is that the controller is the entry-point into an action/routine. It takes external inputs and returns an output to be sent back downstream.
- tabtab 7y agoThat's pretty much true of any function or method.
- johnmaguire2013 7y agoYes, but I'm talking about into the overall system, not into a method.
- justanotherc 7y agoIn many frameworks the controller isn't even the entrypoint anymore though. Laravel for example has a separate router layer, which is the entrypoint that then passes things into a controller.
- tabtab 7y agoIf the controller doesn't fulfill that job, then the model or view model would (for good or bad).