Welcome Guest, Not a member yet? Register   Sign In
passing data to model
#9

[eluser]Colin Williams[/eluser]
Quote:In effect, the model shouldn’t have any awareness of anything other than database interaction.

Make that data service interactions. Data could be from a database, a flat text file, a file directory, XML, external device, etc. I also think this extends to sessions. I used to have misgivings about avoiding using sessions in a model, but I've convinced myself that it absolutely makes sense for a model to interact with sessions, the only persistent data service available when developing on the Web.

Quote:I think it’s a great idea to have some private functions in your controller to build/scrub your data before passing it to model

To some extent this might be a good idea. There is a line to be drawn with how much the controller knows about the model of the objects it works with. The more forgiving your model is, the better. Most models I write can usually just get the $_POST array thrown at it, and it knows what values to ignore when performing any operations.


Messages In This Thread
passing data to model - by El Forum - 03-03-2009, 08:14 PM
passing data to model - by El Forum - 03-03-2009, 08:20 PM
passing data to model - by El Forum - 03-03-2009, 08:20 PM
passing data to model - by El Forum - 03-03-2009, 08:30 PM
passing data to model - by El Forum - 03-03-2009, 08:37 PM
passing data to model - by El Forum - 03-03-2009, 08:52 PM
passing data to model - by El Forum - 03-03-2009, 09:05 PM
passing data to model - by El Forum - 03-03-2009, 09:09 PM
passing data to model - by El Forum - 03-03-2009, 09:10 PM
passing data to model - by El Forum - 03-03-2009, 09:15 PM
passing data to model - by El Forum - 03-03-2009, 09:32 PM
passing data to model - by El Forum - 03-03-2009, 09:44 PM
passing data to model - by El Forum - 03-03-2009, 09:48 PM
passing data to model - by El Forum - 03-03-2009, 09:51 PM
passing data to model - by El Forum - 03-03-2009, 09:55 PM
passing data to model - by El Forum - 03-03-2009, 10:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB