ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل Rashid Anwar , senior php developer , sparx it solution pvt ltd.
تاريخ النشر: 2013/09/25
Arief Shah
من قبل 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
من قبل 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."

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟