← Back to team overview

openstack team mailing list archive

Re: Image API v2 Draft 4

 

Hi,

I have been fighting with these issues.

Here is the proposed solution i am currently using on OpenStack Java SDK.

*Every representation should implement a common interface*

The jaxb annotations for marshalling and unmarshalling XML reside on xml
implementation class
The gson annotations for serialization and deserialization of JSON reside
on json implementation class

This approach is unobstrussive with XML/JSON representations

I think 95% of the API works well mixing jaxb/gson annotations on the same
implementation classes.

This has another advantage, you can switch from one to another service
provider sharing the same model,
that's the interfaces model but the implentation.

Does it make sense for you?

Luis

On Tue, Apr 10, 2012 at 1:11 AM, Jay Pipes <jaypipes@xxxxxxxxx> wrote:

> On 04/09/2012 07:07 PM, Jorge Williams wrote:
>
>>
>> On Apr 9, 2012, at 6:03 PM, Justin Santa Barbara wrote:
>>
>>     How about we discuss this further at the summit :-)
>>>
>>>
>>> I think that's a sensible proposal. We're not likely to reach a good
>>> conclusion here. I think my viewpoint is that even json-dressed-as-xml
>>> is fine; no end-user gives two hoots what our JSON/XML/HPSTR looks
>>> like. I'd wager most users of the EC2 API have never even seen the
>>> data representation!
>>>
>>
>>
>> I take it you didn't attend the glorious JSON debate of a couple of
>> summits ago :-)
>>
>
> Glorious it was indeed.
>
>
>  I'm up for round two,
>>
>
> Only with beer. :) I still owe you a couple I think!
>
>  -jOrGe W.
>>
>>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>



-- 
-------------------------------------------
Luis Alberto Gervaso Martin
Woorea Solutions, S.L
CEO & CTO
mobile: (+34) 627983344
luis@ <luis.gervaso@xxxxxxxxx>woorea.es

References