“In last month’s article, I introduced the Java Reflection API
and ran through some of its basic capabilities. I also looked into
reflection performance, and ended with some guidelines for when
reflection should or should not be used in an application. This
month I’m going even further by looking at an application that
seems to be a good match for reflection’s strengths and weaknesses:
a library for command line argument processing.“I’ll start by first defining the problem to be solved, then
designing an interface for the library before actually getting into
the implementation code. My actual experience developing the
library was not so structured–I started out trying to simplify
existing code in a family of applications that use a common code
base, then generalized from there. The linear ‘define-design-build’
sequence in this article is much more concise than a full
description of the development process, though, and in the process
of organizing it this way I’ve revised some of my initial
assumptions and cleaned up several aspects of the library code.
Hopefully, you’ll find it useful as a model for developing your own
reflection-based applications…”
developerWorks: Java Programming Dynamics, Part 3: Applied Reflection
By
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends, & analysis