2 ms·
Sounds like my reaction on Apple's version MVC: "Do I have to stuff ALL of this stuff into a Controller???". But if I use something like LESS with a ORM or Micr
by dep_b 13y ago
Sounds like my reaction on Apple's version MVC: "Do I have to stuff ALL of this stuff into a Controller???". But if I use something like LESS with a ORM or Microsoft MVC with EF and nice IOC and builder patterns all of a sudden the controller does nothing else but evaluating the request and giving the right kind of response.
- Aqueous 13y agoIndeed. Even if you are not using an ORM, controller functions should be short. Functions are just not supposed to be 30+ lines. If my controller function isn't less than 20 lines of code I look over it and figure out what code can be placed in a library or a model or a view. The controller function should do very little.