Hello Ceki,<br><br>Seems like a good idea to me. But what about making a read-only interface and a read-write interface.<br><br>interface ImmutableLoggingEvent {<br>&nbsp; // only getters<br>}<br><br>interface MutableLoggingEvent {<br>

&nbsp; // getters and setters<br>
}<br><br>LoggingEventMemento implements ImmutableLoggingEvent<br><br>LoggingEvent implements MutableLoggingEvent<br><br>And wherever possible use a ImmutableLoggingEvent .<br><br>Maarten<br>
<br><br><div class="gmail_quote">On Mon, Feb 23, 2009 at 1:44 PM, Ceki Gulcu <span dir="ltr">&lt;ceki@qos.ch&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br>
<br>
I would like to split/redesign the LoggingEvent object as follows:<br>
<br>
interface ILoggingEvent &nbsp;{<br>
<br>
 &nbsp;String[] getArgumentArray();<br>
 &nbsp;CallerData[] getCallerData();<br>
 &nbsp;Level getLevel();<br>
 &nbsp;String getLoggerName();<br>
 &nbsp;Marker getMarker();<br>
 &nbsp;Map&lt;String, String&gt; getMDCPropertyMap();<br>
 &nbsp;String getMessage();<br>
 &nbsp;String getThreadName();<br>
 &nbsp;ThrowableDataPoint[] getThrowableDataPointArray();<br>
 &nbsp;long getTimeStamp();<br>
<br>
 &nbsp;void setArgumentArray(Object[])<br>
 &nbsp;// other setters omitted<br>
}<br>
<br>
<br>
// localized usage, temporary lifespan<br>
class LoggingEvent implements ILoggingEvent {<br>
 &nbsp;// getter and setter methods from ILoggingEvent omitted<br>
<br>
 &nbsp;void prepareForDeferredProcessing();<br>
<br>
 &nbsp;// create a LoggingEventMemento image of this LoggingEvent<br>
 &nbsp;LoggingEventMemento asLoggingEventMemento();<br>
}<br>
<br>
<br>
// distributed (or remote) usage, long term lifespan<br>
class LoggingEventMemento implements ILoggingEvent {<br>
 &nbsp;// getter and setter methods from ILoggingEvent omitted<br>
<br>
 &nbsp;int getVersion();<br>
 &nbsp;makeImmutable();<br>
}<br>
<br>
<br>
LoggingEvent is intended to be used within the application generating<br>
the logging event. LoggingEventMemento is intended for remote<br>
applications (applications other than the application at the origin of<br>
the event) and for longer term lifespan. LoggingEventMemento objects<br>
are intended to be compatible across logback versions. If possible,<br>
LoggingEventMemento should also be suitable for long term storage (on<br>
disk).<br>
<br>
Both LoggingEvent and LoggingEventMemento implement the ILoggingEvent<br>
interface so that most logback-classic components, assuming they<br>
expect to operate on ILoggingEvent instances, will be able to handle<br>
LoggingEvent or LoggingEventMemento objects interchangeably.<br>
<br>
<br>
Instead of LoggingEvent, those appenders which perform serialization,<br>
will be serializing instances of LoggingEventMemento. The<br>
asLoggingEventMemento() method in LoggingEvent will return a<br>
LoggingEventMemento image of a given LoggingEvent.<br>
<br>
Obviously there several technical obstacles to overcome. However, I am<br>
soliciting your comments about the general goals of the above<br>
redesign. Do they make sense? Have I omitted important goals?<br>
<br>
TIA,<br><font color="#888888">
<br>
-- <br>
Ceki Gülcü<br>
Logback: The reliable, generic, fast and flexible logging framework for Java.<br>
<a href="http://logback.qos.ch" target="_blank">http://logback.qos.ch</a><br>
_______________________________________________<br>
logback-dev mailing list<br>
logback-dev@qos.ch<br>
<a href="http://qos.ch/mailman/listinfo/logback-dev" target="_blank">http://qos.ch/mailman/listinfo/logback-dev</a><br>
</font></blockquote></div><br>