Comment sent to our JCP list.
Begin forwarded message:
> From: Markus KARG <markus.karg_at_gmx.net>
> Date: August 7, 2008 5:15:59 PM EDT
> To: jsr-311-comments_at_jcp.org
> Subject: CacheControl fluent API
>
> I appreciate JSR 311 and it's reference implementation Jersey.
> For building a response, there is a fluent API that allows to write
> eloquent code like
> Response.ok(myEntity).cacheControl(myCacheControl).build();
> But: Why is there no fluent API for building the cache control?
> Currently I must write two additional codelines to build even a most
> simple cache control:
> CacheControl c = new CacheControl();
> c.setMaxAge(3600);
> So one could write:
> Response
> .ok
> (myEntity).cacheControl(CacheControl.maxAge(3600).build()).build());
> I mean: Why having a fluent API for Response but not for CacheControl?
>
> Regards
> Markus
>
> --
> http://www.xing.com/go/invita/58469
>
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.