Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MVP and Validation of User Input

MVP and Validation of User Input

Scheduled Pinned Locked Moved C#
regexarchitecture
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mr_lasseter
    wrote on last edited by
    #1

    I have read alot of articles about the MVP pattern. I have looked a several examples, but I most are pretty trivial. I am wondering where the validation of user input should occur. I am guessing it should be in the presenter, but I am not total sure. I have been using CSLA, which is nice but clunky in some areas. I really like the quick validation responses the user gets when the IErrorProvider interface is implemented, but I don't see a way of doing this without junking up the domain model. Hopefully someone can clear this up or point me to an article. Thanks

    J 1 Reply Last reply
    0
    • M mr_lasseter

      I have read alot of articles about the MVP pattern. I have looked a several examples, but I most are pretty trivial. I am wondering where the validation of user input should occur. I am guessing it should be in the presenter, but I am not total sure. I have been using CSLA, which is nice but clunky in some areas. I really like the quick validation responses the user gets when the IErrorProvider interface is implemented, but I don't see a way of doing this without junking up the domain model. Hopefully someone can clear this up or point me to an article. Thanks

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      I've seen the MVP pattern applied in various ways, and the way we apply it here at work may be different than what you're used to. For us, we have validation at several levels: the model object, for example, Employee, "owns" the validation -- you can't make one with bad data. However, we have stuff in place in the presenter to check for valid input (perhaps utilizing the model to determine whether it's valid data), and if it's invalid, update the view accordingly (e.g. highlight the invalid data in red). Something along those lines. Does that help?

      Life, family, faith: Give me a visit. From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'" Judah Himango

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups