users@jsr311.java.net

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

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Tue, 10 Jun 2008 20:12:00 +0100

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