- STAFF PICKS
- GIFTS + GIFT CARDS
- SELL BOOKS
- FIND A STORE
New Trade Paper
Currently out of stock.
available for shipping or prepaid pickup only
Other titles in the DevelopMentor series:
Component Development for the Java Platform (DevelopMentor)by Stuart Dabbs Halloway
Synopses & Reviews
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. COMPONENT DEVELOPMENT FOR THE JAVA PLATFORM reveals both the potential and pitfalls of developing components using the Java platform.As 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.
KEY TOPICS INCLUDE HOW TO:
This is a cutting-edge approach to Java programming: An emphasis on deployment can be the best way to take advantage of some of the most valuable, yet less heralded, aspects of Java technology.
Book News Annotation:
Defining component as "an independent unit of production and deployment that is combined with other components to assemble an application," this guide shows programmers how to use Java to develop components. Chapters cover the class loader architecture, type information and reflection, serialization, customizing class loading, interoperating, and generative programming. The author assumes the reader understands object-oriented programming in Java.
Annotation c. Book News, Inc., Portland, OR (booknews.com)
About the Author
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 JavaPro magazine, and regularly speaks at industry events such as JavaOne. Stuart received his B.S. and M.P.P. degrees from Duke University.
Table of Contents
1. From Objects to Components.
2. The Class Loader Architecture.
Assembling an Application.
Goals of the Class Loader Architecture.
Handling Name and Version Conflicts.
Explicit and Implicit Class Loading.
Explicit Loading with URLClassLoader.
Implicit Class Loading.
Reference Type vs. Referenced Class.
ClassLoader.loadClass vs. Class.forName.
Loading Nonclass Resources.
The Class Loader Rules.
The Consistency Rule.
The Delegation Rule.
The Visibility Rule.
Delegations as Namespaces.
Static Fields are Not Singletons.
Implicit Loading Hides Most Details.
Using Hot Deployment.
Making Sure Classes are Collectable.
Bootclasspath, Extensions Path, and Classpath.
The Extensions Path.
The Bootstrap Loader.
Debugging Class Loading.
Instrumenting an Application.
Instrumenting the Core API.
Inversion and the Context Class Loader.
3. Type Information and Reflection.
The Binary Class Format.
Binary Class Metadata.
From Binary Classes to Reflection.
Reflecting on Fields.
The Difference between get and getDeclared.
Type Errors Occur at Runtime.
Reflecting on Methods.
A Reflective Launcher.
Wrapping Primitive Types.
Bypassing Language Access Rules.
Exceptions Caused by Reflective Invocation.
Delegation Instead of Implementation Inheritance.
Dynamic Proxies Make Delegation Generic.
Implementing a Forwarding Handler.
The InvocationHandler as Generic Service.
Handling Exceptions in an InvocationHandler.
Either Client or Server can Install a Proxy.
Advantages of Dynamic Proxies.
Setting Package Metadata.
Accessing Package Metadata.
Weaknesses of the Versioning Mechanism.
Serialization and Metadata.
Serialization Skips Some Fields.
Serialization And Class Constructors.
Using readObject and writeObject.
Matching Streams With Classes.
Overriding the Default SUID.
Compatible and Incompatible Changes.
Explicitly Managing Serializable Fields.
Writer Makes Right.
Overriding Class Metadata.
Custom Class Descriptors.
Writing Custom Data After defaultWriteObject.
Using writeObject to Write Raw Data Only: Bad Idea.
Pruning Graphs with Transient.
Encouraging the Garbage Collector with Reset.
Ordering Rules for Replacement.
Taking Control of Graph Ordering.
Finding Class Code.
Annotation in RMI.
5. Customizing Class Loading.
Java 2 Security.
The Role of Class Loaders.
Custom Class Loaders.
Pre-Java 2 Custom Class Loaders.
Class Loading Since SDK 1.2.
A Transforming Class Loader.
Implementing a Handler.
Installing a Custom Handler.
Choosing Between Loaders and Handlers.
Getting Past Security to the Loader You Need.
Reading Custom Metadata.
Example: Version Attributes.
Serializable Classes as Attributes.
Reading Attributes During Class Loading.
6. Interop 1: JNI.
The Dangers of Native Code.
Finding and Loading Native Code.
Loading Native Libraries.
Class Loaders and JNI.
Common Errors Loading Native Libraries.
Troubleshooting Native Loading.
Calling Java from C++.
Minimizing Round Trips.
Differences Between JNI and Reflective Invocation.
Error Handling in JNI.
Failures in Native Code.
Handling C++ Exceptions.
Handling Java Exceptions from Native Code.
Throwing Java Exceptions from Native Code.
Interacting with the Garbage Collector.
Managing Native Resources.
7. Generative Programming.
Why Generate Code?
Object Oriented Approaches to Modeling Variabilities.
Thinking in Terms of Bind Time.
Separating Specification From Bind Time.
Choosing a Specification Language.
Reuse Requires More than One Use.
A Little Domain Analysis is a Dangerous Thing.
Why Generate Code with Java?
Type Information Acts As a Free Specification Document.
Class Loading Supports Flexible Binding Modes.
Java Source is Easy To Generate.
Java Binary Classes are Easy To Generate.
Code Generation Boosts Performance.
Levels of Commitment to Code Generation.
A Taxonomy of Bind Times and Modes.
Code Generation in RMI.
Code Generation in JSP.
Code Generation in EJB.
The Deployment Descriptor.
Generating Strongly Typed Collections.
Code Generation Language versus Target Language.
Generating Custom Serialization Code.
Where We Are.
Where We Are Going.
Appendix—Interop 2: Bridging Java and Win32/COM.
What Our Readers Are Saying