Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Fat models and skinny controllers or fat controllers and skinny models which is the better approach while using MVC in developing a web application?

Please justify your answer. Any effort will be appreciated and thanks in advance!

user-image
Question ajoutée par Rashid Anwar , senior php developer , sparx it solution pvt ltd.
Date de publication: 2013/09/25
Arief Shah
par Arief Shah , Software Developer/Project Manager , Durat

Everything SKINNY that is what MVC is all about. Be informed that IoC (inversion of Control) is most effective when everything is seggregated into pieces.

 

 

rizwan yahya
par rizwan yahya , Team Lead , Logo Design Guru

I think fat models are better then fat controlers. below para should give you some idea how it should be like that.

 

"In a well-designed MVC application, controllers are often very thin, containing probably only a few dozen lines of code; while models are very fat, containing most of the code responsible for representing and manipulating the data. This is because the data structure and business logic represented by models is typically very specific to the particular application, and needs to be heavily customized to meet the specific application requirements; while controller logic often follows a similar pattern across applications and therefore may well be simplified by the underlying framework or the base classes."

More Questions Like This