Home » Archive

Articles tagged with: xml

design »

[19 Nov 2006 | 4 Comments | ]

Since Java adopted annotations, I’ve heard a lot of discussion around whether to prefer annotations over external configuration files (often XML) and vice versa.
I think the decision boils down to two criteria:
1) Can annotations simplify the metadata?2) Can changes to the metadata break behavior in your application?
If annotations do not reduce the amount of metadata that you have to provide (in most cases they do), then you shouldn’t use annotation.
I think the more important thing to considered is whether a configuration change could break behavior or not. If not, then …