users@jsr311.java.net

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

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 10 Jun 2008 12:23:10 -0400

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