I'd have to disagree. For constraints you're much better doing it in the type system, where the compiler can check things for you.
e.g. Provide an argument of type ValidatedId instead of a String with a bunch of annotations. I'm also curious to see if the new 'Optional' type gets much adoption vs @NotNull and friends, despite its limitations. On 16 Apr 2013 21:53, "Fabrizio Giudici" <[email protected]> wrote: > On Tue, 16 Apr 2013 22:11:04 +0200, Mark Fortner <[email protected]> > wrote: > > Roland, >> We have a similar problem in the bioinformatics world, where a field like >> "id" could mean an ID from a specific database, an accession (an >> alphanumeric ID similar to a database ID). One way around this is to use >> semantic annotations for fields. Here's an example. >> http://aspenbio.wordpress.com/**2011/01/20/biogroovy-and-the-** >> semantic-web/<http://aspenbio.wordpress.com/2011/01/20/biogroovy-and-the-semantic-web/> >> > > RDF is great for interoperability; for readability in general cases, it's > still good but requires that the reader knows it. > > Generally speaking, annotations can be good for specifying constraints, > pre/post conditions, and improve readability in a easy way. In its small > garden, for instance, things such as @NonNull are simple, intuitive and > deliver some added value. > > > -- > Fabrizio Giudici - Java Architect @ Tidalwave s.a.s. > "We make Java work. Everywhere." > http://tidalwave.it/fabrizio/**blog <http://tidalwave.it/fabrizio/blog> - > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Java Posse" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to > javaposse+unsubscribe@**googlegroups.com<javaposse%[email protected]> > . > To post to this group, send email to [email protected]. > Visit this group at > http://groups.google.com/**group/javaposse?hl=en<http://groups.google.com/group/javaposse?hl=en> > . > For more options, visit > https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> > . > > > -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/javaposse?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
