Component Development for the Java Platform / Edition 1

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 95%)
Other sellers (Paperback)
  • All (14) from $1.99   
  • New (5) from $24.50   
  • Used (9) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$24.50
Seller since 2014

Feedback rating:

(2)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
Paperback New New. Unused. Good condition.

Ships from: Scarborough, Canada

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$31.57
Seller since 2008

Feedback rating:

(17653)

Condition: New
Brand New, Perfect Condition, Please allow 4-14 business days for delivery. 100% Money Back Guarantee, Over 1,000,000 customers served.

Ships from: Westminster, MD

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
$31.58
Seller since 2007

Feedback rating:

(23450)

Condition: New
BRAND NEW

Ships from: Avenel, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
$56.56
Seller since 2014

Feedback rating:

(4)

Condition: New
New

Ships from: Idyllwild, CA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$63.00
Seller since 2010

Feedback rating:

(8)

Condition: New
12-14-01 other 1 BRAND NEW! ONLY Expedited orders are shipped with tracking number! *WE DO NOT SHIP TO PO BOX* Please allow up to 14 days delivery for order with standard ... shipping. SHIPPED FROM MULTIPLE LOCATIONS. Read more Show Less

Ships from: San Jose, CA

Usually ships in 1-2 business days

  • Canadian
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 1
Showing All
Close
Sort by

Overview

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:

  • Use and troubleshoot Class Loaders
  • Build dynamic and generic services through reflection
  • Control an object's serialized representation
  • Load and use native code components
  • Extend the Java class format to add custom services
  • Automate development with code generation

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.

0201753065B11212001

Read More Show Less

Editorial Reviews

From The Critics
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)
Read More Show Less

Product Details

  • ISBN-13: 9780201753066
  • Publisher: Addison-Wesley
  • Publication date: 12/28/2001
  • Series: DevelopMentor Series
  • Edition description: New Edition
  • Edition number: 1
  • Pages: 368
  • Product dimensions: 7.30 (w) x 9.10 (h) x 0.90 (d)

Meet 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.

0201753065AB06182002

Read More Show Less

Read an Excerpt

This book is about developing components using the Java platform. In this book, the term component has a very specific meaning. A component is an independent unit of production and deployment that is combined with other components to assemble an application.

To elaborate on this definition, consider the difference between objects and components. An object represents an entity in the problem domain, while a component is an atomic piece of the installed solution. The object and component perspectives are complementary, and good designs take account of both.

Modern development platforms such as Java provide the infrastructure that developers need to create classes and components. To support object-oriented programming, Java provides encapsulation, inheritance, and polymorphism. To support components, Java provides loaders and rich type information. This book assumes that you already understand object-oriented programming in Java, and it explains how to use Java's component infrastructure effectively.

Loaders are responsible for locating, bringing into memory, and connecting components at runtime. Using Java's loaders, you can

  • Deploy components at fine granularity.
  • Load components dynamically as needed.
  • Load components from other machines on the network.
  • Locate components from custom repositories.
  • Create mobile code agents that live across multiple virtual machines.
  • Import the services of non-Java components.

Loaders manage the binary boundaries between components. In a world of distributed applications and multiple component suppliers, loaders locate and connect compatible components.

Type information describes the capabilities of some unit of code. In some development environments type information is present only in source code. In Java, type information is not merely a source code artifact; it is also an intrinsic part of a compiled class and is available at runtime through a programmatic interface. Because Java type information is never "compiled away," loaders use it to verify linkages between classes at runtime. In application programming, you can use type information to

  • Serialize the state of Java objects so that they can be recreated on another virtual machine.
  • Create dynamic proxies at runtime, to provide generic services that can decorate any interface.
  • Translate data into alternate representations to interoperate with non-Java components.
  • Convert method calls into network messages.
  • Convert between Java and
  • Annotate components with application-specific metadata.
Type information automates many tasks that might otherwise be coded by hand, and it helps to make components forward compatible to platforms of the future.

Who Should Read This Book

You should read this book if you want to design, develop, or deploy substantial applications in Java. Taking a full-lifecycle view of a Java application requires that you consider not just objects, but components. This book is about the core features of Java as a component platform: class loaders, reflection, serialization, and interoperation with other platforms. You should already know the basics of Java syntax and have some experience in object-oriented programming with Java.

This book is not specifically about high-level Java technologies, such as Remote Method Invocation (RMI), Enterprise JavaBeans (EJB), JINI, Java Server Pages (JSP), servlets, or JavaBeans, but understanding the topics in this book is critical to using those technologies effectively. If you learn how to use the component services described here, you will understand how these high-level technologies are built, which is the key to employing them effectively.

Security is also an important aspect of component development and deployment. It is too complex a topic to handle fairly here, and it deserves its own book-length treatment. (See Gon99 for coverage of security on the Java platform.)

Organization of the Book

The chapters of this book fall into three sections. Chapter 1 introduces components. Chapters 2 through 6 explain loaders and type information on the Java platform. Chapter 7 shows more advanced uses of these services.

Chapter 1 introduces component-oriented programming. Component relationships must be established not only at compile time, but also at deployment and runtime. This chapter asks the key questions of component programming and relates them to the Java platform services discussed in subsequent chapters. Though the other chapters might be read out of order, you should definitely read this chapter first.

Chapter 2 shows how to use and troubleshoot class loaders. Class loaders control the loading of code and create namespace boundaries between code in the same process. With class loaders you can load code dynamically at runtime, even from other machines. Class loader namespaces permit multiple versions of the same class in a single Java virtual machine. You can use class loaders to reload changed classes without ever shutting down the virtual machine. You will see how to use class loaders, how the class loader delegation model creates namespaces, and how to troubleshoot class loading bugs. You will also learn to effectively control the bootclasspath, extensions path, and classpath.

Chapter 3 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 you can 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, and custom attributes. Chapter 3 also includes a discussion of reflection performance.

Chapter 4 shows how Java serialization uses reflection. Serialization is a perfect example of a generic service. Without any advance knowledge of a class's layout, serialization can ship both code and state from one virtual machine to another across time or space. You will see how the serialization format embeds its own style of type information and how you can customize that representation. You will also see how to extend default serialization, replace it entirely with custom externalization code, or tune it to handle multiple versions of a class as code evolves. You will then learn how to validate objects being deserialized into your application and how to annotate serialized objects with instructions for finding the correct class loader.

Chapter 5 returns to class loaders and shows you how to implement your own. While the standard class loaders are dominant in most applications, custom class loaders allow you to transform class code as classes are loaded. These transformations could include decryption, adding instrumentation for performance monitoring, or even building new classes on-the-fly at runtime. You will see how to tie your custom class loaders into Java's security architecture, how to write a custom class loader, and how to write protocol handlers that can customize not just how you load classes, but also how you load any other type of resource.

Chapter 6 presents the Java Native Interface (JNI) as a basic means of controlling the boundary between Java code and components written in other environments. JNI provides a set of low-level tools for exposing Java objects to platform native code and native code to Java objects. You will learn to use the JNI application programming interface (API) to translate between Java and native programming styles—which differ markedly in their approach to class loading, type information, resource management, error handling, and array storage. Understanding the deficiencies of JNI sets the stage for Appendix A, which describes a higher-level approach.

Chapter 7 discusses using Java metadata to automate the creation of source code or bytecode. Generated code is a high-performance strategy for reuse because you generate only the exact code paths that you will need at runtime. The chapter first presents JSP and EJB as examples of existing applications that auto-generate code, and then it introduces some ideas for code generation in your own programs.

Appendix A returns to interoperation. By building on the code generation techniques from Chapter 7, Appendix A shows you how to build an interoperation layer between Java and another component platform: Win32/COM. This chapter uses the open source Jawin library as an example, to show you how to generate Java stubs for Win32 objects, and vice versa.

Sample Code, Website, Feedback...

Unless specifically noted otherwise, all the sample code in this book is open source. You can download sample code from the book's website at http://staff.develop.com/halloway/compsvcs.html.

Unless otherwise noted, the code in this book is compiled and tested against the Java 2 Software Development Kit (SDK) version 1.3. Most of the code in the book will work identically under SDK versions 1.2, 1.3, and 1.4. Where this is not the case, the text will include a specific reference to the appropriate SDK version.

The author welcomes your comments, corrections, and feedback. Please send email to stu@develop.com.

Read More Show Less

Table of Contents

Foreword xiii
Preface xv
1 From Objects to Components 1
2 The Class Loader Architecture 11
2.1 Assembling an Application 11
2.2 Goals of the Class Loader Architecture 14
2.2.1 Transparency 15
2.2.2 Extensibility 15
2.2.3 Capability 16
2.2.4 Configurability 16
2.2.5 Handling Name and Version Conflicts 16
2.2.6 Security 17
2.3 Explicit and Implicit Class Loading 17
2.3.1 Explicit Loading with URL ClassLoader 18
2.3.2 Implicit Class Loading 19
2.3.3 Reference Type versus Referenced Class 20
2.3.4 ClassLoader.loadClass versus Class.forName 21
2.3.5 Loading Nonclass Resources 22
2.4 The Class Loader Rules 23
2.4.1 The Consistency Rule 23
2.4.2 The Delegation Rule 24
2.4.3 The Visibility Rule 25
2.4.4 Delegations as Namespaces 27
2.4.5 Static Fields Are Not Singletons 28
2.4.6 Implicit Loading Hides Most Details 29
2.5 Hot Deployment 29
2.5.1 Using Hot Deployment 33
2.6 Unloading Classes 35
2.6.1 Making Sure Classes Are Collectable 35
2.7 Bootclasspath, Extensions Path, and Classpath 36
2.7.1 The Classpath 37
2.7.2 The Extensions Path 39
2.7.3 The Bootclasspath 41
2.8 Debugging Class Loading 43
2.8.1 Instrumenting an Application 44
2.8.2 Using--verbose:class 45
2.8.3 Instrumenting the Core API 46
2.9 Inversion and the Context Class Loader 49
2.10 Onward 55
2.11 Resources 56
3 Type Information and Reflection 57
3.1 The Binary Class Format 58
3.1.1 Binary Compatibility 58
3.1.2 Binary Class Metadata 63
3.1.3 From Binary Classes to Reflection 66
3.2 Reflection 66
3.2.1 Reflecting on Fields 68
3.2.2 The Difference between get and getDeclared 68
3.2.3 Type Errors Occur at Runtime 70
3.2.4 Reflecting on Methods 71
3.3 Reflective Invocation 72
3.3.1 A Reflective Launcher 73
3.3.2 Wrapping Primitive Types 74
3.3.3 Bypassing Language Access Rules 76
3.3.4 Exceptions Caused by Reflective Invocation 81
3.4 Dynamic Proxies 83
3.4.1 Delegation instead of Implementation Inheritance 83
3.4.2 Dynamic Proxies Make Delegation Generic 84
3.4.3 Implementing InvocationHandler 85
3.4.4 Implementing a Forwarding Handler 86
3.4.5 The InvocationHandler as Generic Service 87
3.4.6 Handling Exceptions in an InvocationHandler 89
3.4.7 Either Client or Server Can Install a Proxy 90
3.4.8 Advantages of Dynamic Proxies 91
3.5 Reflection Performance 92
3.6 Package Reflection 94
3.6.1 Setting Package Metadata 95
3.6.2 Accessing Package Metadata 96
3.6.3 Sealing Packages 97
3.6.4 Weaknesses of the Versioning Mechanism 97
3.7 Custom Metadata 98
3.8 Onward 103
3.9 Resources 103
4 Serialization 105
4.1 Serialization and Metadata 105
4.2 Serialization Basics 106
4.2.1 Serialization Skips Some Fields 109
4.2.2 Serialization and Class Constructors 110
4.3 Using readObject and writeObject 111
4.4 Matching Streams with Classes 113
4.4.1 The serialVersionUID 114
4.4.2 Overriding the Default SUID 115
4.4.3 Compatible and Incompatible Changes 117
4.5 Explicitly Managing Serializable Fields 119
4.5.1 ObjectInputStream. GetField Caveats 120
4.5.2 Writer Makes Right 121
4.5.3 Overriding Class Metadata 122
4.5.4 Performance Problems 123
4.5.5 Custom Class Descriptors 124
4.6 Abandoning Metadata 124
4.6.1 Writing Custom Data after defaultWriteObject 124
4.6.2 Externalizable 125
4.6.3 Using writeObject to Write Raw Data Only: Bad Idea 128
4.7 Object Graphs 130
4.7.1 Pruning Graphs with Transient 131
4.7.2 Preserving Identity 131
4.7.3 Encouraging the Garbage Collector with reset 132
4.8 Object Replacement 133
4.8.1 Stream-Controlled Replacement 134
4.8.2 Class-Controlled Replacement 137
4.8.3 Ordering Rules for Replacement 139
4.8.4 Taking Control of Graph Ordering 145
4.9 Finding Class Code 147
4.9.1 Annotation in RMI 148
4.9.2 RMI MarshalledObjects 150
4.10 Onward 150
4.11 Resources 151
5 Customizing Class Loading 153
5.1 Java 2 Security 155
5.1.1 The Role of Class Loaders 157
5.2 Custom Class Loaders 159
5.2.1 Pre-Java 2 Custom Class Loaders 159
5.2.2 Class Loading since SDK 1.2 160
5.2.3 A Transforming Class Loader 162
5.3 Protocol Handlers 168
5.3.1 Implementing a Handler 169
5.3.2 Installing a Custom Handler 171
5.3.3 Choosing between Loaders and Handlers 174
5.4 Getting Past Security to the Loader You Need 175
5.5 Reading Custom Metadata 177
5.5.1 Example: Version Attributes 178
5.5.2 Serializable Classes as Attributes 179
5.5.3 Reading Attributes during Class Loading 183
5.5.4 Debugging Support 188
5.6 Onward 189
5.7 Resources 190
6 Interop 1: JNI 191
6.1 Why Interoperate? 191
6.2 The Dangers of Native Code 193
6.3 Finding and Loading Native Code 194
6.3.1 Name Mappings 195
6.3.2 Type Mappings 195
6.3.3 Overloaded Names 198
6.3.4 Loading Native Libraries 199
6.3.5 Class Loaders and JNI 202
6.3.6 Common Errors Loading Native Libraries 205
6.3.7 Troubleshooting Native Loading 207
6.4 Calling Java from C++ 208
6.4.1 Minimizing Round Trips 211
6.4.2 Performance Comparisons 214
6.4.3 Differences between JNI and Reflective Invocation 214
6.5 Error Handling in JNI 217
6.5.1 Failures in Native Code 217
6.5.2 Handling C++ Exceptions 218
6.5.3 Handling Java Exceptions from Native Code 219
6.5.4 Throwing Java Exceptions from Native Code 222
6.6 Resource Management 223
6.6.1 Interacting with the Garbage Collector 224
6.6.2 Managing Native Resources 231
6.6.3 Managing Arrays 233
6.6.4 Managing Strings 239
6.7 Onward 240
6.8 Resources 241
7 Generative Programming 243
7.1 Why Generate Code? 243
7.1.1 Object-Oriented Approaches to Modeling Variabilities 244
7.1.2 Thinking in Terms of Bind Time 246
7.1.3 Separating Specification from Bind Time 247
7.1.4 Choosing a Specification Language 249
7.1.5 Reuse Requires More Than One Use 249
7.1.6 A Little Domain Analysis Is a Dangerous Thing 250
7.2 Why Generate Code with Java? 250
7.2.1 Type Information Acts as a Free Specification Document 250
7.2.2 Class Loading Supports Flexible Binding Modes 251
7.2.3 Java Source Is Easy to Generate 251
7.2.4 Java Binary Classes Are Easy to Generate 252
7.2.5 Code Generation Boosts Performance 252
7.2.6 Levels of Commitment to Code Generation 252
7.3 A Taxonomy of Bind Times and Modes 253
7.4 Code Generation in RMI 255
7.5 Code Generation in JSP 257
7.6 Code Generation in EJB 260
7.6.1 The Deployment Descriptor 263
7.6.2 Alternate Implementations 265
7.7 Generating Strongly Typed Collections 267
7.7.1 Code Generation Language versus Target Language 270
7.8 Generating Custom Serialization Code 271
7.9 Onward 276
7.10 Resources 279
8 Onward 281
8.1 Where We Are 281
8.2 Where We Are Going 282
8.3 Resources 283
A Interop 2: Bridging Java and Win32/COM 285
Index 319
Read More Show Less

Preface

Preface

This book is about developing components using the Java_ platform. In this book, the term component has a very specific meaning. A component is an independent unit of production and deployment that is combined with other components to assemble an application.

To elaborate on this definition, consider the difference between objects and components. An object represents an entity in the problem domain, while a component is an atomic* piece of the installed solution. The object and component perspectives are complementary, and good designs take account of both.

Modern development platforms such as Java_ provide the infrastructure that developers need to create classes and components. To support object-oriented programming, Java_ provides encapsulation, inheritance, and polymorphism. To support components, Java_ provides loaders and rich type information. This book assumes that you already understand object-oriented programming in Java_, and explains how to use Java's_ component infrastructure effectively. Loaders are responsible for locating, bringing into memory, and connecting components at runtime. Using Java's_ loaders, you can

  • Deploy components at fine granularity
  • Load components dynamically as needed
  • Load components from other machines on the network
  • Locate components from custom repositories
  • Create mobile code agents that live across multiple virtual machines
  • Import the services of non-Java_ components
Loaders manage the binary boundaries between components. In a world of distributed applications and multiple component suppliers, loaders locate and connect compatible components.

Type information describes the capabilities of some unit of code. In some development environments type information is present only in source code. In Java_ type information is not merely a source code artifact. Type information is also an intrinsic part of a compiled class, and is available at runtime through a programmatic interface. Because Java_ type information is never "compiled away," loaders use it to verify linkages between classes at runtime. In application programming, you can use type information to

  • Serialize the state of Java_ objects so that they can be recreated on another virtual machine
  • Create dynamic proxies at runtime, to provide generic services that can decorate any interface
  • Translate data into alternate representations to interoperate with non-Java_ components
  • Convert method calls into network messages
  • Convert between Java_ and XML, the new lingua franca of enterprise systems
  • Annotate components with application-specific metadata
Type information automates many tasks that might otherwise be coded by hand, and helps to make components forward compatible to platforms of the future.

Who Should Read This Book

You should read this book if you want to architect, develop, or deploy substantial applications in Java_. Taking a full-lifecycle view of a Java_ application requires that you consider not just objects, but components. This book is about the subtleties of Java_ as a component platform: class loaders, reflection, serialization, and interoperation with other platforms. You should already know the basics of Java_ syntax, and have some experience in object-oriented programming with Java_.

This book is not specifically about high-level Java_ technologies such as Remote Method Invocation (RMI), Enterprise Java_ Beans (EJB), JINI, Java_ Server Pages (JSP), Java- Servlets, or Java_Beans, but understanding the topics in this book is critical to using those technologies effectively. If you learn how to use the component services described here you will understand how these high-level technologies are built, which is the key to employing them effectively.

Security is also an important aspect of component development and deployment. It is too complex a topic to handle fairly here, and deserves its own book-length treatment. See Gon99 for coverage of security on the Java_ Platform.

Organization of the Book

The chapters of this book fall into three sections. Chapter One introduces components. Chapters Two through Six explain loaders and type information on the Java_ platform. Chapters Seven and Eight show more advanced uses of these services. Chapter One introduces component-oriented programming. Component relationships must be established not only at compile-time, but also at deployment and runtime. Chapter Zero asks the key questions of component programming, and relates them to the Java_ Platform services discussed in subsequent chapters. While the other chapters might be read out-of-order, you should definitely read this chapter first.

Chapter Two shows how to use and troubleshoot class loaders. Class loaders control the loading of code, and create namespace boundaries between code in the same process. With class loaders you can load code dynamically at runtime, even from other machines. Class loader namespaces permit multiple versions of the same class in a single Java_ virtual machine. You can use class loaders to reload changed classes without ever shutting down the virtual machine. You will see how to use class loaders, how the class loader delegation model creates namespaces, and how to troubleshoot class loading bugs. You will also learn to effectively control the bootstrap path, extensions path, and classpath.

Chapter Three 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, and custom attributes. Chapter Two also includes a discussion of reflection performance.

Chapter Four shows how Java_ serialization uses Reflection. Serialization is a perfect example of a generic service. Without any advance of knowledge of a class's layout, serialization can ship both code and state from one virtual machine to another across time or space. You will see how the serialization format embeds its own style of type information, and how you can customize that representation. You will also see how to extend default serialization, or replace it entirely with custom externalization code. You will also see how to tune serialization to handle multiple versions of a class as code evolves, how to validate objects being deserialized into your application, and how to annotate serialized objects with instructions for finding the correct class loader.

Chapter Five returns to class loaders, showing how to implement your own. While the standard class loaders are dominant in most applications, custom class loaders allow you to transform class code as classes are loaded. These transformations could include decryption, adding instrumentation for performance monitoring, or even building new classes on-the-fly at runtime. You will see how to tie your custom class loaders into Java's_ security architecture, how to write a custom class loader, and how to write protocol handlers that can customize not just how you load classes, but also any other type of resource.

Chapter Six presents the Java_ Native Interface (JNI) as a basic means to control the boundary between Java_ code and components written in other environments. JNI provides a set of low-level tools for exposing Java_ objects to platform native code, and native code to Java_ objects. You will learn to use the JNI APIs to translate between Java_ and native programming styles, which differ markedly in their approach to class loading, type information, resource management, error handling, and array storage. Understanding the deficiencies of JNI sets the stage for Chapter 7, which describes a higher-level approach.

Chapter Seven, "Generative Programming," discusses using Java_ metadata to automate the creation of source code or byte code. Generated code is a high-performance strategy for reuse, because you generate only the exact code paths that you will need at runtime. The chapter first presents Java_ Server Pages and EJB as examples of existing applications that auto-generate code, and then introduces some ideas for code generation in your own programs.

Chapter Eight returns to interoperation. Building on the code generation techniques from Chatper Seven, Chapter Eight will show you how to build an interoperation layer between Java_ and another component platform: Win32/COM. Using the open source JAWIN library as an example, you will see how to automatically generate Java_ stubs for Win32 objects, and vice versa.

Sample Code, Website, Feedback...

Unless specifically noted otherwise, all the sample code in this book is open-source. You can download sample code from the book's website at http://staff.develop.com/halloway/compsvcs.html.

The author welcomes your comments, corrections, and feedback. Please send email to stu@develop.com .

* Atomic here means "invisible", not necessarily "stand alone". Most components will have dependencies on other components.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)