can validator be turned off when loading or as on demand?

Posts   
 
    
vairam2008
User
Posts: 86
Joined: 11-Mar-2008
# Posted on: 12-Apr-2008 01:28:10   

can validator be turned off when loading or as on demand? If yes, how? a pointer to help file or other would be greatly appreciated.

http://www.llblgen.com/tinyforum/NewMessage.aspx?QuoteMessageID=9187&THreadID=1635

thanks

vairam2008
User
Posts: 86
Joined: 11-Mar-2008
# Posted on: 12-Apr-2008 01:56:17   

one of the reasons why I don't want it to validate while retrieving or loading is for performance.

reason 2: the data is from the database due to legacy (including current application earlier bug, or older data would have been processed using previous rules at that time.) & I want to perceive that the data is valid when loaded from the persisting mechanism.

I tried dependency mechanism, where the validator is injected based on scope (business component) & the entity is retrieved within the scope. However, my validator requirement to use validator is determined based on the data content (that is period of the createdt column) retrieved in the entity. so seems like I can't use dependency injection mechanism in this scenario. If the validation can be turned off while retrieving. then my validation code can look for the createdt & apply my validation only when the data is modified or when it is required based on conditions inside the validator methods.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 12-Apr-2008 16:39:59   

It's your class, so if you want to switch it off in some situation, pass a value to that object that it should not validate but simply return the base class method or return true.

Frans Bouma | Lead developer LLBLGen Pro