I have been talking to a lot of people about metadata annotations. Although I think they are very useful, I also worry about annotation hell (which I see in some .Net apps).
I think that some people get confused between:
- “I wish I could see that a piece of configuration affected this class/method/field”
- “I want to be able to assign some metadata on this class/method/field”
We see this a lot when people move into AOP. People get scared that they can’t SEE that a cross cutting concern module is affecting their code. Some tools help out here, and they are only getting better.
I think the key is that I want to modularize the concern in one place. I want it DRY. Then, if I need to change something, I can do so in that one place, rather than throughout the code (the whole point).
However, people tend to want to put @CrossCuttingConcern on all of the areas in the code to GET AROUND the problem that they aren’t using a tool that shows them, or allows them to configure something at that point.
I think it is going to be interesting to see us mature more, and have views in our code which come from external areas. I should be able to change a pointcut in one place, and have my source view change if it now applies to different places (ADJT in Eclipse).
So, I hope to not mistake the urge to be able to view things, with the ability to assign them in the place that makes sense.