On Tue, Mar 15, 2011 at 1:01 AM, Stuart McCulloch <[email protected]> wrote:
> On 14 March 2011 08:29, Miroslav Pokorny <[email protected]>wrote: > >> The one thing I always find troublesome with annotation use as a config >> mechanism is they are unmodufiable. >> > > You could always use property-placeholders in annotations, such as @Path( > "${tmp}/${app}/working/" ) and then interpolate the value at runtime - I've > used this in few apps and it solves a lot of the issues about immutable > annotations. > My point was about frameworks (not my own stuff) and how they read and process annotations. Nearly all frameworks dont support placeholders as you mentioned in which case your stuck. Most f/w read some class and then take teh annotations in, they never present an opportunity to change the meta data read from the annotation and alter. The number that do is a very small minority. Annotations and values are like interfaces they are set at compile time, you never get the chance to alter them at runtime (lets forget about manipulating bytecode). You could alter an annotation w/ bytecode but you can only do this once, once the class is loaded those annotations and the values in them are set in concrete. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
