Hi all,
I started implementing an auto update for one class, but had a question before I used it. In my bean, I have support for firing events to notify that a property was changed. In the constructor, I initialize a listener that listens for any property change. When a change occurs, it calls a private update function which basically updates the object in the database.
I was wondering, are there any ramifications of doing it this way? I wanted the classes to automatically handle persistence so any changes made will be taken care of internally.
Maybe it would be better to just provide a public function that can be called to update whenever so this class doesn't make 5 calls to the db when it could just make 1. I think I will still use the property change support.
Walter
|