Friday, November 17, 2006

Automatic discovery of annotated facets

As of v1.3.3, JFacets has a new way of writing facets. After Java/XML and Groovy facets, here comes annotated facets !

The aim of this solution is to enable pure Java facets without any external configuration file (let's get rid of the XML facets descriptor). Basically, you can now annotate some Java classes that implement IFacet, with the @FacetKey annotation. You simply specify the facet assignation parameters as attributes of the annotation. A dedicated Facet Descriptor Manager can be configured so that annotated facet classes are loaded from the classpath at startup.

It's a good tradeoff for people who want anto-discovery but don't want to use groovy.

Read more on the wiki