Welcome Guest, Not a member yet? Register   Sign In
When to use Models ? (just need a little briefing)
#3

[eluser]Colin Williams[/eluser]
Models are the backbone of your application. MVC is discussed as a triad but it's closer to two layers than three. Models handle the main operations of your app (saving, retrieving, formatting/manipulating data) and Controllers work with Views to create the interface.

The controller is the decoupler. It decouples Views from Models and Views from other Views. I think it trips people up who are using it with Web apps because of URL mapping. It gives you the sense that since this URI maps to this Controller method, that the Controller is the big dog, so people start loading up their Controllers with a lot of Model code. But, just look at URLs (and HTTP for that matter) as nothing more than a way for Views to communicate with the Controller, as if you were just calling a function (and URI params and form data are your arguments).


Messages In This Thread
When to use Models ? (just need a little briefing) - by El Forum - 01-20-2010, 03:20 PM
When to use Models ? (just need a little briefing) - by El Forum - 01-20-2010, 03:34 PM
When to use Models ? (just need a little briefing) - by El Forum - 01-20-2010, 05:17 PM
When to use Models ? (just need a little briefing) - by El Forum - 01-20-2010, 06:35 PM
When to use Models ? (just need a little briefing) - by El Forum - 01-20-2010, 07:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB