dev@jersey.java.net

Re: [Jersey][WebDAV]

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 09 Jan 2009 15:51:45 -0500

All I can suggest is that you write a WebDAVResponse and associated
builder and internally defer to the existing Response and
ResponseBuilder classes whenever possible.

Marc.

On Jan 9, 2009, at 2:41 PM, Markus KARG wrote:

>> Internally ResponseBuilder only uses the int value, see the
>> implementation of ResponseBuilder.status(Status). There are methods
>> to
>> set the status code using int and Response.getStatus returns an int.
>> Response.Status is only provided as a convenience and shouldn't
>> prevent use of other status codes.
>
> Yes, certainly one can do that. But see how ugly it is:
>
> ResponseBuilder.status(Response.Status.OK)
>
> compared to
>
> ResponseBuilder.status(WebDavResponse.Status.getInt())
>
> and especielly
>
> ResponseBuilder.ok()
>
> The first one feels intuitive, the second one feels like C++. :-(
>
> Isn't convenience the top idea of the builder API? So if we remove
> convenience, then what is left over that is any better than directly
> writing
> "return new Response(200, "OK");" ?
>
> Regards
> Markus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.