
xiv
Contents
Chapter 11: Developing a Stock Ticker with BlazeDS ............... 285
Installing BlazeDS .............................................................................................................286
Understanding Messaging in Flex ......................................................................................286
Producer and Consumer messaging components .....................................................286
Managing the destination service .............................................................................289
Developing a Stock Ticker Application..............................................................................290
Setting up the messaging config file .........................................................................290
Developing the Java back end ..................................................................................291
Building the Flex user interface ...............................................................................295
Setting the J2EE Server options ...............................................................................295
Building the user interface .......................................................................................296
Developing the ActionScript ....................................................................................297
Bindable variables ...................................................................................................297
Using the labelFunction ..........................................................................................299
Summary ..........................................................................................................................303
Part III: Building Advanced Applications 305
Chapter 12: Developing a Storefront Server Application with Java ..... 307
Application Best Practices .................................................................................................307
Code modularity .....................................................................................................308
Separation of interface and implementation ............................................................308
Developing the Java ..........................................................................................................309
The MySQL database ...............................................................................................310
The Eclipse project ..................................................................................................319
The model layer ......................................................................................................329
The data access layer ...............................................................................................348
The service layer......................................................................................................355
The Ant build file ....................................................................................................365
Deploying and Testing the Web Application .....................................................................367
Summary ..........................................................................................................................370
Chapter 13: Developing a Storefront Server Application with Flex ..... 371
Designing and Developing the Flex Front End ..................................................................371
Communicating with the Java back end ..................................................................372
Developing the product viewer ...............................................................................382
Developing the payment solution ............................................................................395
Summary ..........................................................................................................................397
Chapter 14: Building a Real-Time Messaging System............... 399
Understanding the Application Process .............................................................................399
Writing the Java Code .......................................................................................................400
Setting up the Eclipse project ..................................................................................400
The chat server ........................................................................................................403