Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding MVC: Whats the concept of "Fat" on models, "Skinny" on controllers?
    primarykey
    data
    text
    <p>I'm trying to understand the concept of "Fat" on models vs "skinny" on controllers and from what I've been discussing I have the following example (this is taken from a freenode discussion):</p> <p>Q: On MVC paradigm, its said Fat models, skinny controllers. I'm here thinking, If I have lots of methods (on controller) that uses just a few abstract methods to CRUD (on model), am I creating a fat controller instead of a model ? Or they say, fat model, refearing in what is returned and not typed ? that's something I've never understood =) Any comments are appreciated! Thanks a lot</p> <p>OBS1: I'm not doing whats ment by the model, in the controller, I just have methods that control whats going to the model</p> <p>OBS2: let's say "checkIfEmailExists()", has "john@hotmail.com", as a parameters. This method will, get the return from the model method that querys if this param exist in table, return boolean. If is 0, "checkIFemailExists()" will call a diferent model method, this one, he's just another abstract method, that performs Update operation.</p> <p>OBS3: The "checkIfEmailExists()", isnt just a controller ? He's not actually performing any CRUD, he's just comparing values etc. That's whats confusing me, because in my head this is a controller :S</p> <p>Notes: I guess this is not the best example, since saying "check if something exists",sounds like a query my table operation</p> <p>Q2:just one more question, so, let's say I've got a view form, from where that email address parameter is sent from. Are you saying the view goes directly to the model ?</p> <p>Q3:Shouldn't the controller act between them ? thats the paradigm</p> <p>FINAL NOTE: The discussion ended, saying that I'm wrong, wish is ok (i'm learning). But, so, whats the right answers for Q2 and Q3 ?</p> <p>Thanks for your atention</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload