Sorry I did not get back to you earlier on this.  It seems like most of
the operations you describe should be implemented in the Base* classes. 
I am a bit unclear on how adding a preSave method, which I assume would
need to have some generated code in it to handle the logic you suggest,
would work better than just putting the code into the save method.  Can
you give an example of how it would solve the infinite recursion
problem?  

The preSave method was added by me briefly into cvs as I was
experimenting with adding security to the bo's.  My idea did not pan out
and the method was never used by me and hopefully anyone else.  I backed
it out as soon as jason started down the road to move turbine2.2 onto
standalone torque.

john mcnally


Byron Foster wrote:
> 
> I was wonder what the thinking was behind removing the preSave method
> and if there are plans on implementing alternatives?  The preSave method
> offered a nice way for the base class to provide a more managed and
> safer environment for a derived object to prepare itself to be saved.
> For example a method such as preSave could do the following:
> 
> o Guarantee that the object has been modified, and really will be saved.
> o preSave would be called only once during a save operation.
> o The Base class could prepare itself for operations within the preSave
> that may change what is saved and offer protection against unexpected
> state changes.
> o The Base class could manage when the preSave is called in relation to
> other objects being saved and other preSave method calls.
> o Prevent infinite loops because of OM object method calls from within
> save operations.
> 
> I lean toward making the save methods final,  And only allowing the
> derived OM object to override preSave, or some such method.  I think
> this allows more flexibility in future changes to torque without hosing
> current applications of it.
> 
> Thoughts?
> 
> Thanks,
> Byron
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to