CodeSmith Community
Your Code. Your Way. Faster!

Processor Multiple Broken Rules

Latest post 04-16-2007 10:22 AM by loosecannon. 2 replies.
  • 03-20-2007 4:43 AM

    Processor Multiple Broken Rules

    Hi 

    I've been using NetTiers for a few months now and I think I've got to grips with things but I'm not completely clear on the use of processors.

    It appears to me that the example processor on the NetTiers site (Documentation/Component Layer) will only display the first error it comes across, as the InventoryRuleCheck method returns when it finds an order for a product with insufficient stock i.e. you get one error per rule. What if there were subsequent orders for products with insufficient stock?

    In my project, I want to display all validation failures so that the user is aware there are many problems, not just one. I also want general validation, not just on one property ValidationRuleArgs expects e.g. I want to check that the users have entered all necessary data which may consist of 3 fields in 5 records. It probably doesn't matter if I leave the property name as string.Empty, but I feel like I'm misusing the feature.

    Am I barking up the wrong tree or is this a valid comment? Is there any way of using processors to return all errors, or will I have to write custom validation code?

     

    Also, I noticed that using the example gives me a memory leak in my asp.net app. When I get the Product, it remembers the validation rules (I don't know how, as far as I'm concerned it's a new object!), so when I call service.Execute() the Process method adds the validation rules again, so the array just gets bigger and bigger everytime you go back to/refresh the page! Any ideas anyone??

    Thanks, Martin.

    loose
    • Post Points: 35
  • 03-20-2007 5:22 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 726
    • Points 16,910

    Re: Processor Multiple Broken Rules

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 35
  • 04-16-2007 10:22 AM In reply to

    Re: Processor Multiple Broken Rules

    Thanks for your response but the the threads didn't really help, although I found that validation rules weren't exactly what I needed for the problem anyway.

    Even though I won't be using validation rules in this case, I won't be using them as per the example in the nettiers documentation because of the problems I stated in the first post (i.e. memory leak, etc). Maybe someone will enlighten me one day!


    Thanks again, Martin.
     


     

    loose
    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems