You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by Hendrik Dev <he...@gmail.com> on 2015/04/22 00:17:44 UTC

Serializable classes in Johnzon core (impl)

I propose to remove "implements Serializable" from all of the
implementation classes in Johnzon core (impl).
For most classes it makes no sense to be Serializable and maybe its
not spec compliant (not sure about this). See attached diff.

If its not violating the spec maybe the JsonArrayImpl and
JsonObjectImpl and JsonLocationImpl could be Serializable (this would
make sense if one want persist them or send them over network)

-- 
Hendrik Saly (salyh, hendrikdev22)
@hendrikdev22
PGP: 0x22D7F6EC

Re: Serializable classes in Johnzon core (impl)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Either it doesnt work or it uses other way to be ser.
 Le 22 avr. 2015 13:02, "Hendrik Dev" <he...@gmail.com> a écrit :

> i see but wondering why RI does not not implement Serializable
>
> On Wed, Apr 22, 2015 at 9:01 AM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Hmm, ser was surely maybe badly handled byt this need to be serializable.
> > All spec impl have to be (even generator, builder, factories etc...)
> cause
> > they can be used in a @SessionScoped bean for instance. All our internals
> > (buffers for instance) were just to comply to factories constraint.
> >
> > Now the question is: can we writeReplace/readReplace these instances to
> > avoid the whole impl to be serializable and just limit this constraint to
> > spec API impl. In JSON-P I didn't find a "singleton" to do it but happy
> to
> > get it up, would make it faster and more efficient for factories (think
> we
> > can't help on builders/generators/...)!
> >
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-04-22 0:17 GMT+02:00 Hendrik Dev <he...@gmail.com>:
> >
> >> I propose to remove "implements Serializable" from all of the
> >> implementation classes in Johnzon core (impl).
> >> For most classes it makes no sense to be Serializable and maybe its
> >> not spec compliant (not sure about this). See attached diff.
> >>
> >> If its not violating the spec maybe the JsonArrayImpl and
> >> JsonObjectImpl and JsonLocationImpl could be Serializable (this would
> >> make sense if one want persist them or send them over network)
> >>
> >> --
> >> Hendrik Saly (salyh, hendrikdev22)
> >> @hendrikdev22
> >> PGP: 0x22D7F6EC
> >>
>
>
>
> --
> Hendrik Saly (salyh, hendrikdev22)
> @hendrikdev22
> PGP: 0x22D7F6EC
>

Re: Serializable classes in Johnzon core (impl)

Posted by Hendrik Dev <he...@gmail.com>.
i see but wondering why RI does not not implement Serializable

On Wed, Apr 22, 2015 at 9:01 AM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hmm, ser was surely maybe badly handled byt this need to be serializable.
> All spec impl have to be (even generator, builder, factories etc...) cause
> they can be used in a @SessionScoped bean for instance. All our internals
> (buffers for instance) were just to comply to factories constraint.
>
> Now the question is: can we writeReplace/readReplace these instances to
> avoid the whole impl to be serializable and just limit this constraint to
> spec API impl. In JSON-P I didn't find a "singleton" to do it but happy to
> get it up, would make it faster and more efficient for factories (think we
> can't help on builders/generators/...)!
>
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-04-22 0:17 GMT+02:00 Hendrik Dev <he...@gmail.com>:
>
>> I propose to remove "implements Serializable" from all of the
>> implementation classes in Johnzon core (impl).
>> For most classes it makes no sense to be Serializable and maybe its
>> not spec compliant (not sure about this). See attached diff.
>>
>> If its not violating the spec maybe the JsonArrayImpl and
>> JsonObjectImpl and JsonLocationImpl could be Serializable (this would
>> make sense if one want persist them or send them over network)
>>
>> --
>> Hendrik Saly (salyh, hendrikdev22)
>> @hendrikdev22
>> PGP: 0x22D7F6EC
>>



-- 
Hendrik Saly (salyh, hendrikdev22)
@hendrikdev22
PGP: 0x22D7F6EC

Re: Serializable classes in Johnzon core (impl)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm, ser was surely maybe badly handled byt this need to be serializable.
All spec impl have to be (even generator, builder, factories etc...) cause
they can be used in a @SessionScoped bean for instance. All our internals
(buffers for instance) were just to comply to factories constraint.

Now the question is: can we writeReplace/readReplace these instances to
avoid the whole impl to be serializable and just limit this constraint to
spec API impl. In JSON-P I didn't find a "singleton" to do it but happy to
get it up, would make it faster and more efficient for factories (think we
can't help on builders/generators/...)!



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-04-22 0:17 GMT+02:00 Hendrik Dev <he...@gmail.com>:

> I propose to remove "implements Serializable" from all of the
> implementation classes in Johnzon core (impl).
> For most classes it makes no sense to be Serializable and maybe its
> not spec compliant (not sure about this). See attached diff.
>
> If its not violating the spec maybe the JsonArrayImpl and
> JsonObjectImpl and JsonLocationImpl could be Serializable (this would
> make sense if one want persist them or send them over network)
>
> --
> Hendrik Saly (salyh, hendrikdev22)
> @hendrikdev22
> PGP: 0x22D7F6EC
>