commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-742) Please make PolynomialSplineFunction Serializable
Date Sun, 19 Feb 2012 13:28:34 GMT

    [ https://issues.apache.org/jira/browse/MATH-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211342#comment-13211342
] 

Luc Maisonobe commented on MATH-742:
------------------------------------

bq. I guess that the most trivial problem is serializing with some version of the library
and deserializing with another where the internal structure has changed in the meantime (e.g.
substituting one instance variable with another that would provide the same basic functionality).

I think we can simply say this is not supported. Serialization should not be used for long
time storage, and even if it can be used for distributed computation with different versions
between client and server, we can simply say we don't support it.

bq. Those concerns might be far-fetched and we are totally entitled to ignore them in standalone
applications but in the case of a library, we should not presume of the innocuousness of anything
we put in.

+1 for the concerns of a library, but there are many cases when a simple "implements Serializable"
is sufficient and does not imply too much work.

Could we go for a case by case policy ? There are some classes where serialization could help
users and not be too cumbersome. This is a trade off between forbidding serialization completely
and supporting it for all classes in a guaranteed way with cross-version support.
                
> Please make PolynomialSplineFunction Serializable
> -------------------------------------------------
>
>                 Key: MATH-742
>                 URL: https://issues.apache.org/jira/browse/MATH-742
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.2
>            Reporter: Neil Roeth
>            Priority: Minor
>         Attachments: PolynomialSplineFunction.java
>
>
> PolynomialSplineFunction is not Serializable, while the very similar PolynomialFunction
class in the same package is. All that needs to be done is to add the import:
> {{import java.io.Serializable;}}
> and change this:
> {{public class PolynomialSplineFunction implements DifferentiableUnivariateRealFunction}}
> to this:
> {{public class PolynomialSplineFunction implements DifferentiableUnivariateRealFunction,
Serializable}}
> I made exactly that modification to a local copy and it serialized successfully.  Before
the change, I got serialization errors.
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message