Re: Inheritance of Java classes

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 22 May 2007 14:04:49 +0200

Dhanji R. Prasanna wrote:
> Im not totally convinced on the names of the annotations and if they
> connote something different to @Produce/_at_Consume. I want to try and get
> a deeper understanding before Im totally behind this. For instance, I am
> not sure how multiple mediatypes consumed fits into this.

If you want to have a play i have attached a simple example that works
with the R2 API in SWDP. Copy it into the swdp/rest-impl/samples, cd
into swdp/rest-impl/samples/ProduceTest and type ant run (it should work!)

Then using the command line and curl type these commands:


curl -H "Accept: text/plain"

curl -H "Accept: text/plain;q=0.1"

curl -H "Accept: text/plain;q=0.1, application/xml"

curl -H "Accept: text/plain;q=0.1, application/xml;q=0.0"

curl -d "" -H "Accept: image/jpeg"

curl -d "" -H "Accept: image/jpeg, image/gif;q=0.5"

Similarly you could modify this to play with the ConsumeMime annotation.

Then experiment with inheritance.

> I'm between 3 timezones at once, replying from airport lounges! So Im
> not sure if my comments are fair yet--I'll try and give these sketches a
> good appraisal once Im back home in Australia (soon).


> I think enumerating those edge cases is a good idea. Especially with
> regard to inheritance, it can have a significant impact on how we
> approach the API design.

I will hold off enumerating things, as i do not think it will be helpful
until there is a better understanding of the fundamental concepts.


| ? + ? = To question
    Paul Sandoz