MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guida Utente Pagina 237

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 256
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 236
Build a distributed application with the Java adapter 237
View the assembler class
The contact destination uses the Java adapter. This is one of several types of Data
Management Service adapters that Flex Data Services provides. As previously noted, the
contact destination specifies an assembler class, which is a custom Java class that gets data
from a data resource and handles the synchronization of data among clients and the data
resource.
An assembler must have a zero-argument constructor. The assembler for this application is
instantiated in the application scope, which means that the entire web application has only
one instance of the class. The
scope element in the properties section of the destination
specifies that the assembler in the application scope.
The destination specifies the methods of the assembler class that are invoked to get data and
synchronize multiple versions of data. In addition to those methods, the assembler class also
implements methods for getting individual data items, and creating, updating, and deleting
data items; these methods are implementations of methods in the flex.data.ChangeObject
interface.
The following example shows the source code of the contact applications assembler class. This
class delegates the actual calls to a SQL database, to a data access object (DAO) called
ContactDAO. The source code for the ContactAssembler class and the ContatcDAO class are
in the WEB_INF/src/samples/contact directory. The compiled classes are in the WEB_INF/
classes/samples/contact directory.
Vedere la pagina 236
1 2 ... 232 233 234 235 236 237 238 239 240 241 242 ... 255 256

Commenti su questo manuale

Nessun commento