Exforsys

Online Training

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 ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2005, 09:59 AM
Peter
Guest
 
Posts: n/a
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-05-2005, 05:18 PM
GMailer
Guest
 
Posts: n/a
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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-07-2005, 12:26 PM
paperless
Guest
 
Posts: n/a
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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.