Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Route functions aren't like controllers. Controller is an abstraction that has nothing to do with http. It doesn't correspond to http.

When MVC was shoehorned into http the controller was meant to control the resource, which is how people know of it. But it also controls the collection of resources.

The route function is much simpler than a controller, it only handles one particular method of a resource.



I don't really understand your point. In MVC, we use functions on the controller to handle the incoming request and the response. There is usually a router that routes an incoming request to the corresponding controller and function.

How is this different than what a route function does?


Because a route function is a function and a controller is a collection of functions (that is its own abstraction not directly related to http).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: