Hardcore Java Excerpt
In this chapter from Hardcore Java, "Practical Reflection," Robert Simmons Jr. writes: "Reflection is one of the least understood aspects of Java, but also one of the most
powerful. Reflection is used in almost every major production product on the market,
yet it often has to be learned from developers who are already experts, and these
developers are often few and far between.
The reason for using reflection is because of the difficulties in building complex
projects in a short time."
As an example, he writes that "you can use reflection
to build panels that construct themselves on the fly according to the structure of
the object they are displaying. Instead of designing 200 panels, you can design a tool
that builds panels and works for any object. Despite the added complexity of the
code introduced by using reflection, creating systems with reflection-based tools is
significantly faster and much cheaper to maintain."
This book excerpt is from Hardcore Java, by Robert Simmons, Jr., copyright 2004. All
rights reserved. This chapter is posted with permission from O'Reilly Media.
We are presenting this book excerpt as a PDF download. The file size is a little under 500KB. Download Chapter 9, "Practical Reflection."