commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (COMMONSRDF-49) Make AbstractRDFParser serializable
Date Wed, 15 Nov 2017 22:01:00 GMT


ASF GitHub Bot commented on COMMONSRDF-49:

Github user ansell commented on the issue:
    Having ``Optional`` fields isn't impossible to serialise (as I said erroneously in the
referenced comment), as you could always write custom serialise/deserialise code to support
it, but it isn't supported by default, intentionally: 
    I haven't looked at the code/framework for a long time, but my recollection was that the
parser was based on a single-threaded model after it came out of the multi-thread callable
factory. If you are only expecting to run on a single thread, you may not have the support
structures in place to run over multiple machines in a typical fashion, which is what ``Serializable``
has as one of its implied meanings. That would be a broader discussion though and shouldn't
stop users from benefiting from serialisation in cases where they know it is safe/possible.
    Overall, changing the instance variables to nullable raw types, and then using their accessors
to see them as ``Optional`` is a compromise that allows serialisation without custom coding
for it, and hence this PR looks good to me.

> Make AbstractRDFParser serializable
> -----------------------------------
>                 Key: COMMONSRDF-49
>                 URL:
>             Project: Apache Commons RDF
>          Issue Type: New Feature
>          Components: simple
>    Affects Versions: 0.3.0
>            Reporter: Stian Soiland-Reyes
>            Assignee: Stian Soiland-Reyes
>              Labels: parser
>             Fix For: 0.6.0
> Raised by [~p_ansell] in [pull request 25|(]
> {quote}
> The use of optional here as a field type makes it impossible to serialise. Need to have
the raw values stored in fields if you want to support serialisation in the future, which
should otherwise be possible.
> {quote}
> The suggestion is to avoid {{Optional}} in the private fields of {{AbstractRDFParser}}
so it can be serialized - it can still be {{Optional}} in the accessor methods.

This message was sent by Atlassian JIRA

View raw message