Browse DevX
Sign up for e-mail newsletters from DevX


Book Excerpt: Learn All About ''Type Information and Reflection'' in Java

Java is an object-oriented language, but it is also a component-oriented platform. Java's class-loading model and rich type information makes it possible to build flexible and reusable binary components. This book reveals both the potential and pitfalls of developing components using the Java platform.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

s a platform, Java defines the services needed to connect binary components at runtime safely and reliably. To truly take advantage of all that Java has to offer, you must consider not just development but also deployment, and not just objects but also components. Component Development for the Java Platform delves into the component-oriented features of the Java platform, thoroughly discussing class loading, reflection, serialization, native interoperation, and code generation.

Chapter 3: "Type Information and Reflection" introduces Java type information. Java preserves type information in the binary class format. This means that even after you compile your Java programs, you still have access to field names, field types, and method signatures. You can access type information at runtime via Reflection, and use type information to build generic services that add capability to any object. You will see how to use dynamic invocation, dynamic proxies, package reflection, custom attributes, and more.

Download the PDF of Chapter 3: "Type Information and Reflection"

Reproduced from Component Development for the Java Platform by permission of Addison-Wesley. ISBN 0-201-75306-5. All rights reserved.

Stuart Dabbs Halloway is responsible for the Java curriculum at DevelopMentor, where he teaches the Guerrilla Java and Intensive Java courses. He writes for Sun?s Java Developer Connection(SM) and for Java Pro magazine, and regularly speaks at industry events such as JavaOne. Stuart received his B.S. and M.P.P. degrees from Duke University.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date