|
From: Martin A. <sp...@ma...> - 2008-07-19 07:05:45
|
On 18 Jul 2008, at 17:34, Bill Burke wrote:
> Make it so, should be easy.
>
Uhm? I already did (and yes it was easy), and reverted it back since I
didn't think we could go against the spec. You think I can?
M
> Martin Algesten wrote:
>> But thinking about this, it makes me question this part of the spec.
>> "An implementation is only required to set the annotated field and
>> bean property values of instances created by the implementation
>> runtime. Objects returned by sub-resource locators (see section
>> 3.4.1) are expected to be initialized by their creator and field
>> and bean properties are not modified by the implementation
>> runtime."
>> Why does the spec use an injection style way of initialisation in
>> the first place? I guess because it's kinda new, cool, and less to
>> write.
>> public class OldStyleResource implements UriInfoAware {
>> private UriInfo uriInfo;
>> // Called by framework to give us uriInfo.
>> public void setUriInfo( UriInfo uriInfo ) {
>> this.uriInfo = uriInfo;
>> }
>> public SubResource getSubResrouce() {...}
>> }
>> vs
>> public class ModernStyleResource {
>> @Context
>> private UriInfo uriInfo;
>> }
>> But why doesn't the same logic apply to subresoures? The fact that
>> they've been instantiated by something else that in theory could
>> pass all the wanted references through doesn't seem to be
>> adequate, what if there's a whole heap of stuff to pass through?
>> Doesn't the same neatness logic apply?... I'm not saying that we
>> should traverse the whole object graph of the subresource and
>> inject everywhere, just the top level. if we're trying to do nice
>> new ways of initialising why not do it across the board?
>> M
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win
>> great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in
>> the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
|