|
 |
|
 |
 |
Java Reflection in Action (In Action series)
|
by Ira R. Forman and Nate Forman
Sales Rank: 536475
|
Discount: 40 %
$14.95
At Amazon

|
|
Paperback: 300 pages
Publisher: Manning Publications October 2004
Language: English
ISBN-10: 1932394184
ISBN-13: 978-1932394184
Product Dimensions:
9.1 x 7.2 x 0.8 inches
Shipping Weight: 1.2 pounds
Computing Review
"Well-written . . . presents a difficult topic in a clear and comprehensible fashion."
JavaRanch.com
"Exceptional coverage of an area . . . that is generally poorly covered and often misunderstood."
Customer Reviews & Comments
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
Comment | Permalink |
(Report this)
|
Java Reflection in Action (In Action series)
Discount: 40 %
Available from Amazon
Price: $14.95

| |
|
|
|
|