Proposal: Simplified syntax for dealing with parameterized types. (original) (raw)

brucechapman at paradise.net.nz brucechapman at paradise.net.nz
Mon Mar 23 14:46:48 PDT 2009


Quoting james lowden <jl0235 at yahoo.com>:

Proposal: Simplified syntax for dealing with parameterized types. AUTHOR(S):

my 2 cents:

The interface case is trivial and offers little or no value in terms of added expressiveness other than an alternative syntax consistent with the class case, which is more than enough value IFF the class case can be justified.

The class case can be achieved using a custom annotation, and an AnnotationProcessor to generate the code. Such a solution would be nicer if annotation values could include type literals, but can still be done nice enough to be "adequate for purpose" (IMHO) without them.

The annotations could be placed in package-info.java giving you much of the advantage of your param-types.java file.

So a proposal for type literals and type literals as annotation values would make this proposal redundant, and enable solutions to similar (and not so similar) needs as well. However good this proposal is, type literals as annotation values is even better, because it leverages existing mechanisms to allow developers to solve many problems themselves, as opposed to having the compiler solve one problem.

Bruce



More information about the coin-dev mailing list