I think annotations are quite useful where delegation to application
components is involved. There many examples in Java (Web frameworks, test
frameworks, and others) where they're used quite successfully.

That said I believe WebSocket is not an application level protocol. Compare
to HTTP which offers many things to build useful annotations on (URLs, HTTP
methods, headers, etc). WebSocket is on a much lower level than that. A
JSR-356 container cannot make assumptions about the content of the message
and so the annotations are of limited value.

For this reason I prefer the interface-based model, which JSR-356 does
provide. I wish all the focus had gone into making that the most flexible
and extensible foundation it can be for frameworks to build on top.

Rossen



On Tue, Feb 18, 2014 at 12:10 AM, Mack Gerhardt <[email protected]> wrote:

> Is it me or does anyone else feel like the annotation based setup of a
> WebSocket pojo is like trying to bring dynamic feel of node and python to
> java. Why not have concrete interfaces to implement vs methods to annotate,
> and if you screw up the signature it doesn't work as intended vs
> implementing an interface and knowing at compile time, and having code
> hinting in any ide.
>
> One of the things I love about java is the rigidity, and that it is not
> dynamic, and I can reflect over  classes, and methods. It just feels like
> they are trying to do cool things with jsr-356, instead of a nice clean api.
>
> I am just curious what others think about this
>
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to