|
|||||||||||||||||||||||||||||||||||
|
12 Reviews
|
Average Customer Review
Share your thoughts with other customers
Create your own review
|
|
Most Helpful First | Newest First
|
|
10 of 11 people found the following review helpful:
5.0 out of 5 stars
Outstanding guide to reflection,
By
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.
11 of 13 people found the following review helpful:
4.0 out of 5 stars
Almost great,
By wiredweird "wiredweird" (Earth, or somewhere nearby) - See all my reviews (HALL OF FAME REVIEWER) (TOP 500 REVIEWER)
Amazon Verified Purchase(What's this?)
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
4 of 5 people found the following review helpful:
5.0 out of 5 stars
A practical "how to" manual for applying reflection,
By Midwest Book Review (Oregon, WI USA) - See all my reviews
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.
1 of 1 people found the following review helpful:
4.0 out of 5 stars
Reflect upon more flexible ways to write Java code,
This review is from: Java Reflection in Action (In Action series) (Paperback)
I first ran across the concept of reflection in Java in Cornell's Core Java book back when I was first learning the Java programming language in 1998. However, that book just treated reflection as a set of cute pet tricks of which Java is capable. Interested in a particular aspect of a class? Use this or that method and inquire. Only thing was, as a developer of code and not of tools, I found this aspect of Java interesting but not particularly useful. This book gave me a whole new respect for the tool of reflection. In a large multimedia application, my main program was going through a long series of if statements and looking for matching strings and then calling the matching sub-application. It worked, but it was large, clunky, and not very maintainable. I read this book and got the idea for a much more elegant solution. Rather than enumerate each class, I build the class name of the object I need from my list of options to construct and instantiate using reflection at runtime. Mind you, I didn't read or buy this book with that solution in mind, the author was just so clear in talking about the usefulness of reflection that the idea came to me. That's just one of the uses I've found for reflection in reading this book. Trust me, you don't have to be a software tool developer to get good mileage from it. I highly recommend it. I list the table of contents just because the product description does not have it listed:
1 A few basics 1 2 Accessing fields reflectively 27 3 Dynamic loading and reflective construction 49 4 Using Java's dynamic proxy 73 5 Call stack introspection 107 6 Using the class loader 121 7 Reflective code generation 143 8 Design patterns 179 9 Evaluating performance 207 10 Reflecting on the future 225 appendix A Reflection and metaobject protocols 241 appendix B Handling compilation errors in the "Hello world!" program 253 appendix C UML 256 I subtract one star because this book was written before Java 1.5 came out, and new features have been added. However, it is still a good place to start when you want to see just what reflection in Java can do for you.
2 of 3 people found the following review helpful:
5.0 out of 5 stars
Must have for any Java developer,
By
Amazon Verified Purchase(What's this?)
This review is from: Java Reflection in Action (In Action series) (Paperback)
If, for any reason I had to keep only 10 Java books, this one would have made this list. It's consise, up to the point and covers not only Java reflection, but many other important subjects such as class loaders, design patterns, design with interfaces, proxies, et al.
I'm a technical writer myself and follow the simple rule: "the book/article is ready when you can't remove anything from it". The authors have managed to cover complicated topics in a 250-page book that has nothing to remove.
5.0 out of 5 stars
Neat little guide to reflective programming,
By Ganeshji Marwaha (India) - See all my reviews
This review is from: Java Reflection in Action (In Action series) (Paperback)
Java Reflection is an extremely powerful API that most modern frameworks like Spring, Hibernate, XFire, JUnit etc., use as its core enabling technology. We all use these frameworks for our applications, but never really bothered to see how the framework achieves certain things that it does.
This might be because we think reflection 1. is complex --> maybe it is, but do you think that it should stop you when it can cater more elegant/flexible/reusable code. 2. is an advanced topic --> maybe it is, that is why we are learning this after learning the basics first. 3. performs poorly --> Latest versions of java has considerably improved reflection API's performance. Also, there is an entire chapter dedicated to performance in this book. 4. for framework programmers only --> Not any more 5. is not necessary --> It is not necessary until you learn it. Once you learn it, you will wonder how you even lived without it. Today, Reflection is being used even for application requirements such as 1. Flexible and re-usable code 2. Implementing cross-cutting concerns 3. Validation 4. Dynamic addition/modification of functionality... and much more... In this book, the Foremans do an excellent job of preaching the advantages of using reflection. They are pragmatic in that, they keep you adviced that reflection is a magic-bullet only when used for the right purposes. The chapters are well organized and starts with the basics and goes all the way to the most advanced concepts. The authors start with a simple scenario where reflection could be useful. Using this scenario they teach the basics of Class and Method objects, how to find the class of an object at runtime, how to invoke a method on that object etc. The next couple of chapters takes "Serialization of Java objects to XML" as the use-case and explains the concepts of accessing fields reflectively, dynamic class loading, dynamic object construction etc. Moving onto the advanced concepts, the author takes you through a tour of dynamic proxies, custom classloaders, call stack introspection, performance metrics etc. At this point, the authors stop to point out the shortcomings of the java reflection API and show you how to use Code-Generation technique to work around those limitations. Finally, the authors give a sneak-peek at java 5 and how it is going to change the reflection API. I have a couple of suggestions for this book though 1. This book needs a java 5 update 2. Java beans API could have been discussed at a shallow level atleast. Though java beans does not belong to the reflection api, it is <<-- well -->> indirectly related. Overall, I found this book easy to read, rich in content, pragmatic in advice and i highly recommend it to any "moderate to experienced" java developer who wants to construct code that speaks for itself.
5.0 out of 5 stars
Excellent guide to reflection and reflection in java,
By rdf "rdf_acm" (Cambridge, Ma. USA) - See all my reviews
Amazon Verified Purchase(What's this?)
This review is from: Java Reflection in Action (In Action series) (Paperback)
The authors know a great deal about reflection in general and use it to ground a clear, detailed explanation of how to use reflection in Java.
My only qualm about the book is their discussion of the use of microbenchmarks to evaluate the impact of reflection upon execution speed. My experience is that microbenchmarks such as these, give you a best case lower bound on execution speed. Echoing the other reviews, every Java programmer should know this. It will make your code cleaner, better and more maintainable. The book also contains an excellent set of references to help the reader explore the general topic of reflection in greater depth.
5.0 out of 5 stars
Add this to your Java library,
By
This review is from: Java Reflection in Action (In Action series) (Paperback)
I purchased this book with the idea that it would provide insight into some of the lesser known qualities of Java, and this book did. The examples were thorough and full of real world possibilities. I really enjoyed the authors' writing style, and I appreciate their ability make reflection and introspection so interesting. I feel like this was one big tool that I added to my toolkit.
5.0 out of 5 stars
A MUST for every Java Programmer,
By
This review is from: Java Reflection in Action (In Action series) (Paperback)
This book gives a complete overview of the reflection concepts and its use in Java. Nowadays reflection is a topic that every programmers have to cope with but few of them really understand what are its potentiality.
This book helps in this direction it doesn't only cover the canonical aspects of reflection in Java such as the API and the programming but also some critical aspects usually neglected by the other books on the same topic such as the performance issues and code generation. It also explores the dynamic aspect of reflection in Java presenting in a good and interesting way the Proxy classes. Moreover the book is really well written and I have appreciated the George's example that follows us all along the book, I find the explaination by example the better way to teach new concepts. So if you are looking for a book that explain you the magic of Java reflection this book is the book that you have to buy.
5 of 9 people found the following review helpful:
5.0 out of 5 stars
If only it could do everything marketing promised.,
By
This review is from: Java Reflection in Action (In Action series) (Paperback)
I spend most of my life re-doing old code that for some reason needs to be expanded, changed, fixed or whatever. The old story about writing the program is only 10% of the effort, (really it may be 2%) is true. If you could double the time spent writing the program itself it would be well worth it (if the world would let you). Wouldn't it be nice to have programs that - without work on your part - could exmanine itself and then change to do something else depending on what it finds.
Reflection won't take twice as long to code. But it will a bit take longer in the design phase. Nor can reflection promise to do everything that the salesmen can promise to the new prospects, nothing can do that. Reflection is a technique that can be of great value in some instances, it's ceratinly something you need to have in your mental toolbox. This book is by one of the pioneers in reflection, and his son who uses reflection to solve day-to-day problems. |
|
Most Helpful First | Newest First
|
|
Java Reflection in Action (In Action series) by Ira R. Forman (Paperback - Oct. 2004)
$44.95 $28.44
In Stock | ||