users@jsonb-spec.java.net

[jsonb-spec users] Re: Comments on EDR

From: Romain Manni-Bucau <rmannibucau_at_tomitribe.com>
Date: Fri, 29 Jan 2016 09:16:35 +0100

Hi Sebastian,


very interesting ideas. I added few comments inline.


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau

2016-01-29 9:08 GMT+01:00 Sebastian Daschner <java_at_sebastian-daschner.de>:

> Hi experts,
>
> Thanks for the work done so far.
>
> I have some comments / questions on the Early Draft.
>
>
> 1) As Section 1.2 states JAX-RS should be integrated with JSONB. Are
> there already plans in which functionality such an integration will cover?
>
> It would be very helpful for enabling Hypermedia in JSON responses to
> have the possibility to create URIs to JAX-RS resources -- ideally via
> annotations.
>
> For example JAX-RS's UriBuilder [1] provides helpful functionality to
> create URIs. Do you think it's feasible to add something like
> @JsonbResourceLink(<jaxrs-resource-class>.class, "methodName") -- idally
> with the possibility to replace path params with properties of the POJO?
>
>
It sounds interesting but wonder if the JAXRS DSL is not more expressive in
practice cause then you need to exclude the other properties from the
serialization Sounds a more complicated API than it looks like first, no?.


>
> 2) JsonbAdapter has parameterized methods rather than JsonbAdapter
> itself being a parameterized type (as it is for JAXB's XmlAdapter). What
> were the ideas behind this?
>
> While implementing some examples I noticed that it would be helpful to
> have concrete types of both the ValueType and the BoundType in the
> method bodies, otherwise the Object's have to be casted. Or am I missing
> something here?
>
>
This changed yesterday, now we have JsonbAdapter<A, B> and
adaptFrom/adaptTo with the corresponding types.


>
> 3) Are there discussions to enable CDI integration for JsonbAdapters?
> IMO a drawback of JAXB's XmlAdapter was not to be able to inject CDI
> managed beans.
>
> We often had the situation in projects that we wanted to deserialize
> some primitive into a more complex object using logic from existing JEE
> components.
>
>
Not yet discussed but this is an good point.


>
> 4) Is there a roadmap for an early version of the RI? Btw, I would be
> glad to contribute if there is a need for more workforce...
>
>
The RI has to be released with the spec. As a side note Johnzon (
https://git-wip-us.apache.org/repos/asf?p=incubator-johnzon.git;a=summary)
 started to implement it as well and discussions are mainly about adapters
ATM.


>
> [1] https://docs.oracle.com/javaee/7/api/javax/ws/rs/core/UriBuilder.html
>
> Cheers,
> Sebastian
>