[ 
https://issues.apache.org/jira/browse/CONFIGURATION-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702889#action_12702889
 ] 

John Bollinger commented on CONFIGURATION-203:
----------------------------------------------

The argument that developers just shouldn't do that isn't very appealing to me, 
though it is an accurate description of one of the outcomes of the fact that 
Configurations aren't serializable.  Moreover, it misses the point of why 
serializability is useful: the main use case is *not* the client passing 
configuration to the server to configure it (or vise versa); rather it is 
serialization of objects on either side that hold references to their own 
configuration so that they can be passed over RMI (including to remote EJBs) or 
written to external storage (e.g. to passivate the object).  It doesn't matter 
how or whether the configuration is *used* after serialization / 
deserialization because you don't even get there successfully.

With that said, I agree that many of the concrete Configuration implementations 
probably resist being made serializable.  If enabling externalization of 
configuration objects were a priority then I would argue for a redesign of the 
API to separate the data structure(s) for configuration from the mechanisms for 
loading / reloading them.  That would be a rather dramatic shift, however, and 
I suspect there isn't going to be much support for doing that.

As for adding a save(OutputStream) method to Configuration, I don't think that 
is meaningfully different from making Configuration extend Serializable.  If a 
configuration can implement save(OutputStream) then it can also implement the 
readObject() and writeObject() methods that would enable it to be serialized 
and deserialized by the standard mechanism.

> Make Configuration Serializable
> -------------------------------
>
>                 Key: CONFIGURATION-203
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-203
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Joe Wolf
>            Priority: Minor
>             Fix For: 2.0
>
>
> It would be nice if org.apache.commons.configuration.Configuration extended 
> java.io.Serializable and its implementations were serializable as well.  
> Theoretically, most configurations are constructed from "serialized" data 
> sources.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to