Good practice |
[eluser]moodh[/eluser]
[quote author="shadow player" date="1310398082"] Quote:can you post a link to that thread? I’d be interesting in reading their reasons for that http://chat.stackoverflow.com/transcript...893#985893 Quote:Lets say you want to validate user input but not admin input, through the same model? Admin input has to be validated too. Stuff admins can input and users can't (i.e. HTML in a post) are commonly set on a permission level. If an admin accesses a common routine in a model (i.e. creating an user) that would 'normally' be accessed on user registration - he still has to enter a valid email address for the user.[/quote] What if there's different rule sets for admins and users? Should you create a massive model instead of 2 thin controllers? That just seems well.. Weird. Models should have a clean interface towards the database. What if you build a script to use a model that really doesn't need any validation? Then you'd have tons of validation in the way. Validation is only needed for user input, there's nothing saying your models wont be used by the system itself in various situations. |
Messages In This Thread |
Good practice - by El Forum - 07-09-2011, 09:18 AM
Good practice - by El Forum - 07-09-2011, 09:35 AM
Good practice - by El Forum - 07-09-2011, 01:40 PM
Good practice - by El Forum - 07-09-2011, 03:01 PM
Good practice - by El Forum - 07-09-2011, 03:55 PM
Good practice - by El Forum - 07-09-2011, 06:54 PM
Good practice - by El Forum - 07-10-2011, 12:12 PM
Good practice - by El Forum - 07-10-2011, 04:34 PM
Good practice - by El Forum - 07-11-2011, 02:50 AM
Good practice - by El Forum - 07-11-2011, 04:28 AM
Good practice - by El Forum - 07-11-2011, 10:01 AM
Good practice - by El Forum - 07-11-2011, 02:03 PM
Good practice - by El Forum - 07-11-2011, 04:38 PM
Good practice - by El Forum - 07-12-2011, 01:03 AM
Good practice - by El Forum - 07-12-2011, 01:10 AM
Good practice - by El Forum - 07-12-2011, 03:34 AM
Good practice - by El Forum - 07-12-2011, 03:49 AM
Good practice - by El Forum - 07-12-2011, 04:15 AM
Good practice - by El Forum - 07-12-2011, 09:29 AM
Good practice - by El Forum - 07-14-2011, 08:42 PM
Good practice - by El Forum - 07-14-2011, 08:51 PM
Good practice - by El Forum - 07-16-2011, 04:46 PM
|