users@jsr311.java.net

Re: Path annotations for class resources

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 28 Feb 2008 14:28:31 +0100

Sergey Beryozkin wrote:
> Hi
>
> > That is not correct. It is a requirement for a *root resource class*, as
> > per section 1.5 Terminology.
> I have no problems with it. But don't you think it's a bit too restrictive ?
> The root resouce classes have already been implicitly nominated by a
> user, when registering them
> with the JAX-RS runtime.

They way things are specified is that a root resource class requires
that a URI path context is associated with it so that path matching can
be performed on that root resource class. @Path declares that context.
Do you want to use something other than @Path to specify the URI path
context when registering root resource classes?

Since this is an annotation-based API it makes sense to keep the
meta-data close to the code rather than being separate and using
something other than an annotation. It also makes the classes more
portable for different types of registration algorithm and container.
For example Jersey scans for @Path on classes and automatically
registers them and the developer does not have do any configuration. I
understand others impls are also doing similar things.


> Having default values even for root resource
> classes also simplifies the implementation a bit,

Not sure i understand. Can you provide an example?

Paul.

> as far as handling
> resource classes is concerned. not a big deal though...
>
> Cheers, Sergey
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109