dev@jsr311.java.net

RE: New sketch of updated APIs

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Mon, 23 Apr 2007 09:04:22 +0200

Hi Dhanji and Paul,

[...]

> > Do you mean a list of returned metadata (i.e. headers)? Are
> you thinking
> > of something like List<HeaderValue>?
> >
>
> Yes, or something generic like:
>
> List<Pair<String, T>>
>
> Namely this links back to the RESTlet approach. It would be useful to
> compare the pros/cons as this is quite a fundamental abstraction.

Exactly, in the Restlet API, we have a generic Parameter class (a name/value
couple) and then we define a Series<E extends Parameter> class which
implements List<E extends Parameter> interface and adds many helper methods
(like getFirstValue() and add(name, value).

The advantages are the ability to keep track of the initial order of the
headers, to handle repeating headers. Also it stikes a good balance between
memory usage and performance.

Best regards,
Jerome

PS: The correct spelling is "Restlet" instead of "RESTlet" :)