jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Annotations CoC [Was: Convention Over Configuration]

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 06 Apr 2011 08:20:50 -0400

On 4/6/11 7:51 AM, Marek Potociar wrote:
> On 04/04/2011 04:03 PM, Adam Bien wrote:
>> On 04.04.2011, at 14:22, Marek Potociar wrote:
>>> On 04/04/2011 10:27 AM, Adam Bien wrote:
>>>> On 18.03.2011, at 11:23, Marek Potociar wrote:
>>>>> On 03/17/2011 10:05 PM, Adam Bien wrote:
>>>
>>>>>> Putting the name of the method inside @Path would violate the DRY principle.
>>>>>
>>>>> Not if it is considered just a coincidence, which is also our case.
>>>>
>>>> I have to disagree here. The method name in JAX-RS actually doesn't matters right now.
>>>> Putting a @Path("something") on a nameless method would be the DRY-est thing.Because it is not possible in Java, I would go with the convention.
>>>>
>>>> In JPA there are very similar conventions - the names of the attributes are just assumed as names of columns, what can be overridden.
>>>
>>> What I meant to say, that CURRENTLY it is just a coincidence as JAX-RS 1.x does not have any concept of CoC here. I
>>> don't have a strong opinion on this topic and I am open to discussion here. We need to look at various naming patterns
>>> people use and think about how to address them (getXxx vs. subXxx vs. xxx ...).
>>
>> Even Bil Burke is convinced - and it was a hard talk :-)
>
> You certainly don't need to convince me ;) When I said that I am open to discussion I meant that we need to agree on the
> algorithm of deriving the default value for @Path annotation from the Java method/class names. Did you happen to
> convince Bill about any such particular algorithm?

Something very simple for @Path that is easy to remember. Any other CoC
would based on method signature (i.e. get, post, put, etc.) would
probably break backward compatibility.

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