Most Helpful Customer Reviews
10 of 11 people found the following review helpful:
5.0 out of 5 stars
Outstanding guide to reflection, December 8, 2004
This review is from: Java Reflection in Action (In Action series) (Paperback)
There are only a handful of books that every Java programmer should own. This book manages to enter into that elite group of books by providing exceptional coverage of an area of Java programming that is generally poorly covered and often misunderstood. Reflection is a topic that many programmers know about but don't truly understand. Reflection can provide simple ways to get out of complex problems, which makes it well worth knowing. Reflection is one of those tools that you never knew you needed until you learn it.
The authors of this book are a father/son team that have been working with reflection for years. They attack reflection in small pieces, making each topic crystal clear before moving on to the next. In keeping with the "action" from the title, the authors show examples of each aspect of reflection, breaking down each line of code with complete explanations.
The book starts with the basics of reflection, looking at how to examine a class at runtime and dynamically load it. The book then moves on to demonstrating how to use the Proxy class. Later chapters show how to examine the call stack, customize class loaders, and transform one class into another. Performance is covered with a chapter that gives some good examples of benchmarking the cost of using reflection. The book ends with a look at the impact of Java 1.5 on reflection.
The best advice I can give is, buy this book. You will be amazed at the things that you didn't know you could do with Java.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
11 of 13 people found the following review helpful:
4.0 out of 5 stars
Almost great, January 4, 2006
This review is from: Java Reflection in Action (In Action series) (Paperback)
This book presents an unusual but surprisingly important Java API, the one that underlies component technologies, dynamic loading, and more. Reflection isn't just for ubergeeks writing debuggers and similarly gutsy applications, it can help with everyday tasks of many kinds. The Formans show how, using many examples and a friendly but technically dense style.
The book covers all the basics. It starts with the whole idea of metaprogramming, writing programs about programs. Maybe it sounds involuted, but the first two chapters show how it works for handling the basic features of an application, the methods and fields. The next topics cover object creation: first, objects of classes that already exist, then classes created on the fly using Java's Proxy mechanism. A little later, they cover class loaders and custom loaders in the clearest, best-motivated discussion I've seen anywhere. The chapter on Design Patterns is, as in so many books, somewhat perfunctory. I've used reflection to analyze DPs in running programs, so I found that chapter disappointing. The last chapter begs to be rewritten. This book was in production when Java 5 was on the horizon, but issued after Java 5 hit the streets. Java 5 introduced many new features such as annotation, and new reflective APIs to support them. That last chapter looks forward to features that have since become real - not a fault of the authors', but enough reason for a second edition.
There are some real problems in this book, though. A minor one is that the reflection API isn't actually laid out entire anywhere in the discussion, but JavaDoc will take care of that for you. More importantly, serialization is a crucial part of the component technologies that reflection supports. This book largely disregards the standard APIs and SPIs in favor of an ad hoc, roll-your-own approach. Trust me, that's a bad idea. See Halloway's aging 'Component Development' book or old editions of 'Java in a Nutshell' for much more complete treatment of real serialization. Part of the problem in this treatment of serialization is its weak discussion of the inheritance hierarchy: when serializing a subclass, you have access to only half of an object. The superclass[es] is[are] the other half, and may have private data that the subclass can't serialize on its own. This weakness recurs in an otherwise interesting discussion on checking of invariants. The approach in this book seems to forget that the subclass invariants are only half of the object invariants, and the superclass is not handled. Also, as Szyperski notes, invariants interact subtly with callbacks, a discussion conspicuous by its absence.
This is an advanced book that Java newbies might not benefit from, and I don't mean that as a criticism. It's for experienced programmers with big, complex problems. It's for dynamic, extensible systems, the kind that we all want to work on. Even though it's Java-based, it's for anyone programming in any reflective language, at least until your language gets its own version of this book. Despite some significant problems, I recommend this book highly.
//wiredweird
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
4 of 5 people found the following review helpful:
5.0 out of 5 stars
A practical "how to" manual for applying reflection, December 5, 2004
This review is from: Java Reflection in Action (In Action series) (Paperback)
Java Reflection In Action by the collaborative team of Ira and Nate Forman is a practical "how to" manual for applying reflection to computer programming. Reflection is the ability of a running program to look at itself and its environment, and change what it does according to what it sees. It is an inbuilt feature of the Java language and allows one to sidestep a common source of maintenance woes. Java Reflection In Action walks the programmer through a complete understanding of reflection and some of the most useful reflective solutions to replace "hard-coded" ones. An excellent self-teaching resource for intermediate to advanced students and practitioners of Java programming, Java Reflection In Action is packed from cover to cover with examples, flowcharts, sample code, and more, all effectively designed to facilitate instruction.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
|
|
Most Recent Customer Reviews
|