Exforsys
+ Reply to Thread
Results 1 to 3 of 3

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

  1. #1
    Peter 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



  2. #2
    GMailer 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.




  3. #3
    paperless 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



Latest Article

Network Security Risk Assessment and Measurement

Read More...