Kiss My App

Tuesday, November 23, 2004

The Annotated Dream

IMHO, the most prominent feature in J2SE5 is not generics, enums, or new for loops; it's annotations.

Annotations are better than Aspects since they are explicitly declared on your methods/fields/classes and checked by the default compiler. You may argue that Aspects and annotations aren't the same thing, but I believe Aspects are there to provide additional behavior within a specific context or protocol-- where now that context/protocol can simply leverage annotations declared on your objects. An example is a persistence protocol. Either you write Aspects and pointcut all of your objects to provide additional behavior/properties for persistence, or simply have your persistence mechanism "read" the behavior/properties off of the object you pass it.

I would like to see JavaServerFaces annotated just like EJB 3.0. The annotations wouldn't be a substitution to in-page declarations, but as a secondary solution for those who want a cleaner seperation of validation/conversion rules from the view. Imagine declaring a POJO bean with some JSF validation annotations and some EJB annotations. How easy would it be to modify and persist objects from a web page?

3 Comments:

Post a Comment

<< Home