On Wednesday 24 November 2004 04:51, Marcus Crafter wrote:
Since persistence of any component will require the logger to be re-set on the component when it's recovered we thought it would make sense to set the m_logger field to 'transient' in AbstractLogEnabled?
The change would be:
private Logger m_logger;
becomes:
private transient Logger m_logger;
+1. I doubt anyone depends on non-transient loggers! Do remember to put in a testcase for something like that :-D
Generally speaking; To obtain long term compatibility of serialization, it is wise to implement the readObject() and writeObject() methods plus setting the serialVersionUID variable.
serialVersionUID and its associated tool suck ass as an idea, but its the only thing which always works :/. However, IIRC XStream doesn't work as well if you use these. Kinda defeats its purpose.
If that is done, transient has no effect.
Testing of such compatibility also requires that serialized instances are saved and checked in to the code repository. :o)
If the AF is going to be properly serializable, I suggest that it is done properly across all classes, incl. of the tests.
+0 (agree but not going to do the work...)
- LSD
PS: I'm "old school" in the sense that I think serialization of components/services as in "things that *do* stuff" is not that good an idea, and instead you should be serializing data objects (ie the configuration objects).
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Apache Excalibur Project -- URL: http://excalibur.apache.org/
