Wednesday, February 6, 2013

MVC - Do they have personalities?

Model -View-Controller(MVC) is interestingly simple, but hard in other ways to understand. I've been going through tutorials on MVC.

MVC is so intertwined with one another almost like distant realitives, you don't really know them but at Thanksgiving  then you need to know every one's names and how they are related to each other, kind of like MVC. So I thought maybe if I gave MVC some personality that might help.

 First off it shouldn't be MVC,           it should be:               C    
                                                                                          M  V

because it's all about the controller first, not the other way around. I got stuck for a while thinking I should be working on the model first then the controller.


Controller:  Think of that really grouchy old guy Mr. Potter in "It's a Wonderful Life" and his favourite quote is: " It's my way or the highway!"

View:  The person who gets all the credit for everyone else's work...kind of like how CSS robs HTML of all it's glory.

Model:  The model is like a pair of underwear, we need it, but we are more than likely going to be changing it everyday(in this case every project).

Controller and View you should try to reuse as much as possible for other things,  Model is basically not reused. Each projects model is it's own.

I apologize for mutilating MVC like that, but that's how my mind works, if I can make it more human I can relate :) - Josh