
- Forum
- Testing
- Software Patterns
- mvc: where does validation occur?
mvc: where does validation occur?
This is a discussion on mvc: where does validation occur? within the Software Patterns forums, part of the Testing category; hi guys, when implementing mvc with a web application where should validation take place. in the view? the controller? or ...
-
04-25-2005, 08:59 AM #1Peter Guest
mvc: where does validation occur?
hi guys,
when implementing mvc with a web application where should validation
take place. in the view? the controller? or the model?
or even all three?
cheers, peter
-
05-05-2005, 04:18 PM #2GMailer Guest
Re: mvc: where does validation occur?
It has to be well-balanced.
Basic validations can be balanced between client-side JScript or
server-side messages. (This is where validations can be put into the
view)
I dont have a case where Controller may need validation apart from
checking where the control is being passed.
Model can have business validations and through effective use of the
exception mechanism built on top Java exception framework.
-
05-07-2005, 11:26 AM #3paperless Guest
Re: mvc: where does validation occur?
What do u mean by where shuld validation take place??
It should take place where it is required?
View should do validation for what it has got is correct..
Model should validate the current value and whether the changed value
is acceptable or not. And that requests are properle handled threads
are synchronized properly and model is always consistent.
controller should ensure that requests should be properly delegated to
model.
To perform all these whatever validation is required put it in the
correct place.
-
Sponsored Ads

Reply With Quote





