In his blog post “Dependency Management Beyond Language Boundaries” Sebastian Kübeck describes a problem that is not unique to Java projects, but has had its peeks in it because Java has the privilege of being “mainstream” and thus the testbed for all kinds of “new ideas” to heal the world.
I like his introductory sentence very much because it describes one of my main concerns about how static languages can lead people into dangerous solutions for problems that can be solved much more elegant in dynamic, reflective languages:
In the meantime, Java is quite an old lady in IT terms and had to survive various hype phases which all left their traces in legacy applications. One of them was the XML configuration mania which left us with numerous XML configuration files. This was followed by the Annotation pseudo cure that obfuscated our source codes in such a way that we couldn’t see the source code forest within all those annotation trees.
Annotations and the overuse of external (XML or whatever) files for configurability to the extreme are typical cases of premature flexibilisation that can lead to very high maintenance cost (Did you ever have to debug a Struts application?). Unfortunately, the Smalltalk world is currently in danger of overusing Method Pragmas, which bear the potential for similar problems like Annotations do in Java. They may be helpful, but they can also lead to practically non-understandable code, where you simply don’t know what’s happening in your system.
The rest of Sebastian’s article shows how it’s possible to check Struts configurations for correctness in unit tests. A good piece of inspiration, not only for Java developers!