users@jsr311.java.net

Re: Annotations on interfaces and super classes <was> Re: URI Contracts

From: Sean Landis <sean.landis_at_gmail.com>
Date: Tue, 10 Jun 2008 18:32:12 -0600

The operative word is "also". The use (or overuse) of inheritance and
interfaces are certainly not ubiquitous nor universally recognized as
good things. (I am not saying they aren't, btw).

I certainly hope we aren't driving design decisions based on EJB, or
Spring, or Guice. I think JAX-RS ought to play nicely with these
others but should not be subservient to any of them. I am still a big
fan of containerless services.

I fear annotation explosion but I like the notion of contracts as
first class entities.

I hope I'm not missing the context here but it feels like the big
picture is getting lost. It would be a pity to make choices that bound
JAX-RS too tightly to technologies or strategies when that isn't
necessary.

Sean

On Tue, Jun 10, 2008 at 1:12 PM, Sergey Beryozkin
<sergey.beryozkin_at_iona.com> wrote:
> I agree. Also, supporting annotations on interfaces/subclasses may minimize
> the cost of changes. For ex, given a ProduceMime annotation on the interface
> and a number of concrete implementations, changing the value of that
> ProduceMime won't affect the implementations.
> On a somewhat orthogonal note, I'd like to say that IMHO it's somewhat
> unclear as to why to go to some lengths and introduce a lot of annotations
> such that it's very easy for Java developers to expose their classes as
> RESTful services while still staying in the Java comfort zone, while
> 'denying' them the possibility of inheriting the annotations from
> interfaces/subclasses...
>
> Cheers, Sergey
>
>
>
>
> Stephan Koops wrote:
>> Hi Bill,
>>> You'll have to elaborate on your concerns. Modeling services with
>>> inheritance and interfaces is pretty much ubiquitous with any Java
>>> component model and users will be scratching their heads if it is not
>>> supported in the specification. I know I have found both subclassing
>>> and interfaces extremely useful in the few things I have done with
>>> JAX-RS.
>> I've seen in one of your blog entries, that you made this proposal.
>> Could you give an example?, where it was useful?
>>
>
> Interfacing and subclassing is basic Java OO design, why take that power
> away from a developer?
>
>
> You want specifics, so, here's what I've found them useful for in the
> few things I've done. For interfaces, I've found they fit naturally
> with the EJB model. I can integrate portably with EJBs in our JAX-RS
> implementations. For subclassing I wrote a JAX-RS JMS facade. There is
> a lot of overlapping functionality that can be encapsulated in
> subclasses and shared between Queue and Topic destinations. (BTW, this
> prototype is also where I found the need for singletons as I needed
> resources that could hold resource state between requests.)
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>