dev@jsr311.java.net

Re: JSR311: Re: Inherited Path

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 05 Feb 2008 11:58:08 -0500

Marc Hadley wrote:
> On Feb 4, 2008, at 6:04 PM, Bill Burke wrote:
>>
>> I hope you're not saying that we shouldn't support JAX-RS on
>> interfaces at all. I'm fine with KISS too. either you put it on the
>> interface or the bean class. Sure makes the spec simpler :)
>>
> Actually I'm struggling to come up with a simple set of rules but if you
> can come up with some I'd be receptive. In particular I think that
> merging and overriding of annotations is quite tricky when you get down
> to the details.
>

I don't have much experience with @Inherited or metadata merging between
interfaces and bean classes. From an EJB perspective, I always thought
of an interface as the published view of a bean class not the bean class
implementing a specific contract.

> FWIW, here's where we are wrt the spec and Jersey:
>
> - @ConsumeMime and @ProduceMime are both @Inherited so they can be used
> on superclasses.
> - Resource classes are introspected using Class.getMethods. This will
> include methods inherited from superclasses but note that a method
> overriding one in a superclass requires its own annotations - we don't
> do any annotation merging.
>

IIRC, that's basically how EJB3 handled things. Try to conform to the
rules of the language. This is why I think KISS might be better and an
either/or policy used with interfaces/bean classes.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com