2009/4/10 Rémi Dewitte <[email protected]>

> Hello,
>
> I thank you all to clear my mind about annotations.
> Annotations are probably good to get started with a hello world or minimize
> the amount of code you would write. But you lose some compilation checks and
> moreover developing further more complex resources will require to
> understand how it works (routing/switch logic) and which methods will not be
> called because of the use of annotations. If I want to search for resources
> class will I have to search for @Resource as well ? How far are we from
> annotated Restlets ?


You get better compile-time checking with annotations than with a scheme
that dispatches based on method name.

Take another look at the 1.2 first resource example. I think this is much
more readable and clear than the 1.1 example.

I don't see a reason to use annotations on Restlets. Do you?



> Would it be possible to have ServerResource free of annotation logic and an
> AnnotatedServerResource subclass removing the need for isAnnotated ?
>

How important is it to have separate classes? Why not just have an
unannotated ServerResource use default (fixed) method names as with 1.1?
Anyone who wants to use different, more application-specific method names
can use the annotations, but no one would be forced to. Wouldn't that make
everyone happy?

--tim

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1626878

Reply via email to