Showing posts with label annotation. Show all posts
Showing posts with label annotation. Show all posts

Sunday, June 5, 2016

Put a Spring in your step

I don't know about you, but when it came time for me to figure out Spring's Java Annotation based configuration, I found it difficult to know what I really needed to do.  Between well-meaning but outdated online tutorials, many different versions of the software each with its own quirks, and some guys who just plain got it wrong, I found the process far more confusing than it should be.

In fact, once I stripped a program down to its most basic elements (and I don't think there's much left to do here at all), it's kind of embarrassing to think I ever had a problem with it.  In short, it's short.  I found myself left with three classes, a few annotations, and a working program.

Then just to gussy it up a bit, I created a complete alternate implementation of the entire package tree, which you can cause the program to use by specifying the package name as a command line parameter.  You can create other implementations as well, link them in via separate jar files and run those, too, so long as the classes in question implement the interfaces in the 'resources' package.

Without further ado, here is the Spring Java Config Demo.  I may update it with a few additional features in the days to come, but whatever I do add will be done in the most minimalist fashion possible.