Welcome to daoFlex

 

Your Flex  development with Java just got easier.

Flex Remoting and DataServices require substantial development effort supporting data persistence. See for yourself: working with Java adapters you need to build: Data Access Object and matching Assembler, Java DTO and matching DTO on the ActionScript side; include file for remoting-config.xml and data-management-config.xml. All these classes are pretty obvious and yet … require time and attention. They contain hard-coded names of the fields. To function properly they have to be kept all in sync. At the end of the day, even a simple CRUD screen will cost you at least 3-4 hours of Java coding and biting your nails after every naming or configuration mistake.

This complexity is taken away of by daoFlex utility (download at http://www.faratasystems.com/download/daoFlex/daoFlex.zip) , which generates complete stack of Remoting and FDS code based on the simple definitions of annotated Java abstract classes, such as the one below:

package com.theriabook.datasource;

 

import java.util.Date;

import java.util.List;

 

/**

 * @daoflex:webservice

 *   pool=jdbc/theriabook

 */

 

public abstract class Employee {

 

     /**

     * @daoflex:sql

     *  sql=:: SELECT * from employee

           where start_date < :startDate or start_date=:startDate

     *     ::

     *  transferType=EmployeeDTO[]

     *  keyColumns=emp_id

     *  updateTable=employee

     */

 

     public abstract List getEmployees(Date startDate);

}

 

 

 

Setup of daoFlex Code Generator.

Please follow the instructions from http://www.faratasystems.com/download/daoFlex/setup.htm.

Running daoFlex.

Running daoFlex is pretty simple: you execute ANT build file from Eclipse.  ANT task will perform code generation, compilation and jarring. Here is the extract of the console output of daoFlex code generator:

 

 

Testing and Using daoFlex Output.

Once DaoFlex generation is complete you can use test MXML files create by daoFlex. See below how the simple test application looks like. All that - without writing a single line of code! All you have to do is run ANT/daoFlex through annotated Java classes. A small ~ 15Kb run-time library daoflex-runtime.jar with a handful of classes is all you need to add to your web application:

 

 

 

 

What’s cool?

We now support complete data synchronization via Flex Remoting.

ActionScript class DataCollection, descends from ArrayCollection, but it is “destination-aware” and has fill() and sync() methods by itself. DataCollection knows how many elements have been modified, created, deleted, etc and can manipulate them freely.

ActionScript class BatchService allows sending updates to more then one ArrayCollection as a single unit of J2EE work (transaction). By the same token you can batch collection updates with arbitrary remote calls, say invoking a stored procedure in the same transaction. And watch this: without writing a single line in Java, except defining abstract classes.

So now you can use Flex Remoting for your data synchronization with back-end on par with Flex Data Services. These technologies are complementary to each other. Use DataServices when you need server push and pagination. For all other cases Remoting is sufficient. Classes generated by doaFlex are universal for either solution. You take the side, we will supply the ammo J

Roadmap for daoFlex.

ANT based daoFlex is an open source product available under GPL license. Current release is 0.10. Our next milestone is commercial Eclipse plug-in for daoFlex.

 

Thanks,

The daoFlex team @ FarataSystems, LLC