Search   

Friday, February 10, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  To use Dirty St...
 To use Dirty State Management for validation?
 
 5/15/2006 5:45:40 PM
anonymous
20 posts


To use Dirty State Management for validation?
 Modified By anonymous  on 5/15/2006 5:48:58 PM)
Hi, can I use the Dirty State management somehow for the business logic? We would like to implement validation and other tasks after a business object is changed. N.N.
 5/15/2006 5:52:05 PM
Mirko
109 posts
5th


Re: To use Dirty State Management for validation?
 Modified By Mirko  on 5/15/2006 5:55:27 PM)
One possibility for validation is to use callback interfaces. Theoretically it would also be possible to use an interceptor for the communication between the object and NDO. But I use another technique in my own projects. Changing an object can create a temporarily inconsistent state that is corrected by a following change - an event after each change would incorrectly report an error. I use a binding component that validates the objects after the all changes are done. The component takes care of a first validation of the input _before_ the object is changed - that way it is possible to check if the input is of correct type or length. In conjunction with that you can also use the information in the mapping file that is available as object tree in the PersistenceManager. Referring to the above mentioned callbacks: You can implement the IPersistenceNotifiable interface in your classes which supplies methods like OnSaving and OnLoading. These methods are called by NDO at the appropriate points. The OnSavingEvent of the PersistenceManager is also available. It supplies all objects, which were just created, changed, or deleted in a list. The property NDOObjectState allows you to query the status of an object. pm.HasChanges allows to detect if any changes occured that need to get saved. Best Regards, Mirko.
  NDO-Forum postings in english please, if possible.  Developing with NDO  To use Dirty St...
  SearchSearch  Forum HomeForum Home