
Java Beans developer's resource
Prashant Sridharan - Collection The resource series
Résumé
Features:
- Shows developers how to use the Java Beans API to build
reusable Java object components that can be customized and
packaged at will.
- Introduces Java's component model, discusses Java Bean
properties, events, introspection and persistence, and
covers Java Bean networking.
- Compares Java Beans with OLE, ONE and OpenDoc, and
shows how Beans are already being used successfully in the
real world.
- Contains a CD-ROM which includes Java Beans Developer's
Kit, JDK 1.1, Java Studio, and Java Workshop.
- With a step-by-step approach, the book walks users through designing and creating a Java Beans component, linking it, and reusing it in many applications at once.
Table of contents :
Acknowledgments ..... xvii
Introduction ..... xix
What You'll Need ..... xix
How to Read This Book ..... xx
Parts Is Parts ..... xx
Appendixes ..... xxi
CD-ROM ..... xxi
Conventions ..... xxi
Icons ..... xxii
Code ..... xxii
Sidebars ..... xxiii
Closing Thoughts ..... xxiii
Part One: Introduction to Java and Components .....
1
Chapter 1: Advanced Java ..... 3
Basic Java ..... 3
Object-Oriented Design Using Java ..... 4
Applying Good Object-Oriented Design Skills ..... 10
OOP Strong, Efficient, and Effective ..... 13
Introduction to Threading in Java ..... 13
What are Threads? ..... 13
Threading in Java ..... 15
Thread Summary ..... 23
Object Serialization ..... 23
What is Serialization? ..... 23
Handling Object Relationships ..... 24
The Output Streams ..... 25
Handling Object Webs ..... 25
Reading Objects ..... 26
Security and Fingerprinting ..... 27
Serialization Overview ..... 27
The Java Event Model ..... 28
The Old Model ..... 28
Delegation ..... 29
Reflection ..... 31
How Reflection Works ..... 31
Reflection Objects ..... 33
Using Reflection ..... 51
Chapter 2: Component Models ..... 53
Component Models ..... 54
What are Components? ..... 54
Component Customization ..... 55
Component Introspection ..... 55
Component Interaction ..... 56
Component Persistence ..... 58
Component Construction ..... 58
Components Versus Object-Oriented Programming .....
58
Modularity in Components ..... 59
Hiding Information in Components ..... 59
Smart Methods in Components ..... 60
Design Patterns ..... 61
Design Patterns in Beans ..... 61
Circumventing Design Patterns ..... 61
Beans as Components ..... 62
Components Using Beans ..... 62
Special Beans Objects ..... 62
Java and Components ..... 63
Why Beans? ..... 63
Introduction to the Rainbow Button ..... 66
A Button for All Seasons ..... 67
Individual Components ..... 67
Properties ..... 68
Events ..... 69
Graphical Representation ..... 70
Beans Containers ..... 71
Listeners ..... 71
Bean Hierarchy ..... 72
User Interfaces ..... 72
Part Two: Core Beans Technology ..... 74
Chapter 3: Bean Events ..... 77
The JavaBeans Event Model ..... 78
Publish and Subscribe System ..... 78
Event Characteristics ..... 78
Event Delivery ..... 80
Custom Events ..... 82
Event Listeners ..... 82
Creating an Event Listener ..... 83
Design Patterns for Events ..... 83
Implementing the Listener ..... 84
Adding Listeners to Beans ..... 85
Creating the Bean ..... 85
Registering a Listener ..... 86
Registering a Unicast Listener ..... 88
Listener and Event Deadlocks ..... 89
Attaching Listeners to a Bean ..... 90
Firing Events ..... 91
Listener Registration in a Nutshell ..... 93
Event Adapters ..... 94
Firing Events ..... 94
Creating an Adapter ..... 96
Complicated Adapters ..... 99
Rainbow Button Events ..... 101
Creating Events ..... 101
Creating the Button ..... 102
Implementing the Picture Area ..... 106
Sounds From Afar ..... 107
Chapter 4: Bean Properties ..... 111
When to Use Properties ..... 112
What is a Property? ..... 112
Why are Properties Important? ..... 112
Design Patterns ..... 113
Accessors ..... 114
Mutator ..... 115
Arrays and Indexed Properties ..... 117
Boolean Properties ..... 120
Property Listeners ..... 121
Producers of Information ..... 121
Consumers of Information ..... 129
Constrained Properties ..... 131
Customization ..... 137
Property Sheets ..... 137
Property Editors ..... 138
Customizers ..... 142
Properties in the Rainbow Button ..... 146
Button Properties ..... 146
Picture Properties ..... 150
Sound Properties ..... 151
Creating a Wizard for the Rainbow Button ..... 151
Chapter 5: Bean Introspection ..... 155
What is Introspection? ..... 156
Introspection and Java ..... 156
Handling Your Own Introspection ..... 156
Design Patterns for Properties ..... 156
Design Patterns for Events ..... 157
Beans and Introspection APls ..... 158
Bean Descriptors ..... 158
Bean Information ..... 159
Simple Bean Information ..... 163
Feature Descriptors ..... 164
Event Set Descriptors ..... 167
Property Descriptors ..... 170
Indexed Property Descriptors ..... 174
Method Descriptors ..... 176
Parameter Descriptors ..... 177
Introspectors ..... 177
Introspecting Another Bean ..... 180
Creating a Bean ..... 180
Creating the Bean Information ..... 180
Rainbow Button Introspection ..... 185
Using the Bean Information Object ..... 186
Using Reflection Instead ..... 187
Chapter 6: Bean Persistence and Packaging .....
189
Serialization and Beans ..... 190
Setting Up a Bean for Persistence ..... 190
Invoking a Serialization Algorithm ..... 192
Saving Serialization Files ..... 193
How the Java Sandbox Affects Serialization ..... 194
Deserialization and Beans ..... 195
Opening the Serialization File
Setting Up a Bean for Restoration ..... 195
Recovering a State ..... 196
Using Another Form of Persistence ..... 197
Introduction to JDBC ..... 197
Database Drivers ..... 198
Setting up a Bean for JDBC ..... 200
Setting up JDBC ..... 200
Invoking persistence with JDBC ..... 201
Restoring a Saved State from JDBC ..... 204
Packaging the Button ..... 205
Packaging as a Standard ..... 205
JAR File Format ..... 206
Manifest Files ..... 208
Adding Security to the JAR ..... 209
Packaging a Serialized State ..... 216
Part Three: Advanced Beans ..... 218
Chapter 7: GUI Builders ..... 221
Loading a Bean ..... 222
Locating and Loading a JAR File ..... 223
Examining the Property Sheet ..... 223
Editing a Property ..... 224
Following a Customizer ..... 226
Packaging the Bean ..... 226
Creating a Bean Application ..... 227
Selecting the Source ..... 227
Following the Interaction Wizard ..... 227
Testing the Interaction ..... 229
Interactions and Events ..... 230
Saving a Bean ..... 232
Other GUI Builders ..... 232
Chapter 8: Bean GUI Issues ..... 235
GUI Merging ..... 236
What is GUI Merging? ..... 236
Setting up GUI Merging Within a Bean ..... 237
Using GUI Merging ..... 238
Visibility ..... 248
The Visibility Interface ..... 248
Using the Visibility Interface ..... 249
Chapter 9: Bean Integration
ActiveX Primer ..... 254
History of ActiveX ..... 254
Building a Control ..... 256
Using a Control ..... 256
ActiveX and Security ..... 257
Building an ActiveX Bean ..... 259
How the Bridge Works ..... 259
Converting a Bean to a Control ..... 259
Issues with Converting ..... 263
Using the Bean Control in an ActiveX Container .....
266
JavaScripting a Bean ..... 269
What is Javascript? ..... 269
Hooking Beans Together with JavaScript ..... 276
Chapter 10: Bean Networking ..... 279
Firing CORBA Events ..... 280
What is CORBA? ..... 280
Creating a CORBA Client ..... 289
Creating a CORBA Server ..... 292
Talking to RMI Servers ..... 296
What is RMI? ..... 296
Creating an RMI Client ..... 303
Creating an RMI Server ..... 305
Issues for Networked Beans ..... 307
Networked Beans Architecture ..... 307
Firing Networked Events ..... 309
Part Four: Cool Beans ..... 312
Chapter 11: Beans in the Real World ..... 315
Using Beans ..... 316
A Bean Warehouse ..... 316
Enterprise Beans ..... 316
Bean Applications ..... 317
Making Money ..... 317
Licensing and Ownership ..... 318
A Business Model for Components ..... 322
Appendix A: Quick Start Guide ..... 327
Expert Developers ..... 327
Beginning Developers ..... 328
Additional Resources ..... 330
Publications ..... 331
Web Sites ..... 331
Newsgroups ..... 332
Appendix B: The BeanBox ..... 333
Starting the BeanBox ..... 334
Using the BeanBox ..... 334
BeanBox Contents ..... 335
Loading a Bean ..... 337
Connecting Beans ..... 337
Adding Your Own JAR Files ..... 339
Appendix C: CD-ROM ..... 341
Web Page ..... 341
Samples ..... 342
Developer's Kits ..... 343
Software ..... 343
Index ..... 345
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Prentice Hall |
Auteur(s) | Prashant Sridharan |
Collection | The resource series |
Parution | 18/07/1997 |
Nb. de pages | 353 |
EAN13 | 9780138873080 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse