Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMike Pickett
9,775 PointsDid I miss the reference to the DB in the video? I have watched it twice and didn't hear any DB reference.
I am possibly missing something here but I didn't hear any mention of a DB in the video. I have notes that the Model notifies the controller & view of status changes - is the controller the DB in this question?
2 Answers
Ken Alger
Treehouse TeacherMike;
Great question. The MVC (Model-View-Controller) model can initially be a little challenging to grasp where all of the pieces fit. Here is how I have come to terms with the responsibilities of each piece.
Model
The Model directly manages the data, rules, and logic of the application. This would be where the database falls into place.
View
The View is what the end user sees, the data represented as viewable output.
Controller
The Controller accepts input and then converts those commands for the View or the Model to act upon those commands.
Perhaps this diagram will help:
Does that help at all? Very high level of MVC, but by keeping in mind what and where things are done, it can help to make sure code goes into the right spot.
Happy coding,
Ken
Mike Pickett
9,775 PointsKen,
Thank you! That should help - I've copied this and will keep it as a reference.
Mike
Ken Alger
Treehouse TeacherMike;
In reviewing my answer I apologize for not addressing your specific question about the video. I would have to review the video again for specifics, but you had it correct in that, generally speaking, it is the job of the Model to notify the other components of changes in data status.
Ken