Clear Data Builder for Flex

Clear Data Builder for Flex (CDB-F) is an open source and free productivity tool for Adobe Flex, Air and Java EE applications.

Earstwhile known as simply Clear Data Builder (CDB), so references to CDB within the confines of this wiki node and it's children should be considered as CDBF, i.e. original, Flex version of the CDB.

Elsewhere you may find references to CDB for HTML5 (CDB-H), which in is upcoming release will support Ext JS with Ext.Direct/JEE and BlazeDS/JEE.

CDB writes Flex and Java code for you. All artifacts required for bringing together Flex, BlazeDS, and popular Java frameworks: Spring, Hibernate, and MyBatis CDB generates automatically.

Source code is hosted on the SourceForge as part of the Clear Toolkit Project under MIT license. Commercial support of CDB is available from the source: Farata Systems.

Why Clear Data Builder?

If your ever tried to create a combined Flex-Java-BlazeDS-DBMS project, you spent hours just to see a window populated with the simple data. Implementing data persistence is even more time consuming. How about keeping track of the data changes made by the user via UI? Want to automate the creation of ActionScript Data Transfer Objects (DTO) based on their Java peers? CDB substantially saves time by automating most of these efforts.

You go through a set of simple steps to declare what data do you need (using SQL or Hibernate) and let CDB generate and deploy all the artifacts: Java, Flex and configuration files. Below, getCompanyAssociates is annotated to return all records from a company_associate table1) and this declaration is all you write to build a BlazeDS service that returns a collection of employee data (Run view-source enabled demo):

package com.farata.test.service;
import java.util.List;
import com.farata.test.entity.CompanyAssociate;
import clear.cdb.annotations.*;
public interface ICompanyService {
	@CX_JPQLMethod(query="SELECT a FROM CompanyAssociate a WHERE companyId=:companyId")
	List<CompanyAssociate> getCompanyAssociated(Integer companyId);

Throw in one more Java annotation to generate a sample MXML application…

	@CX_JPQLMethod(query="SELECT a FROM CompanyAssociate a WHERE companyId=:companyId")
	List<CompanyAssociate> getCompanyAssociated(Integer companyId);

…and now you have a Flex test application that runs against Java/Spring2)/Hibernate code that you did not write!

Is CDB The Right Tool For Me?

Do you know any other open source and free tools that automate creation of Flex/Java CRUD project? We don't.

CDB's project wizard makes creation of the BlazeDS/Spring/Hibernate code a breeze. Then, CDB generates well organized Java and Flex code.

How Do I Start with CDB and other Clear components?

The best way to start with CDB is by following the hands-on workshop Getting Started with Clear Data Builder (Workshop). Alternatively, you can follow the chapters of the ClearWiki starting from the Tutorials section.

Other resources:

Do I Have To Use Hibernate?

No, you do not. Your Java Services can contain any custom Java methods, in particular - based on such lightweight persistence framework as myBatis or legacy SQL. To simplify creation of custom collection-oriented services , CDB offers a special @CX_FillMethod annotation. You can freely mix Hibernate-based methods and custom ones in the same project and even in the same service.

Do I Have To Use Spring?

No, you do not. Turn off the Spring support checkbox during the project creation if you do not want it. By default, all your services are Spring enabled.

How Integration with the Spring Framework Works?

Once you elect Spring support in the CDB Project Wizard the BlazeDS MessageBroker is managed by the Spring container: CDB annotates generated Java services with @RemotingDestination and the project configuration ensures that message routing goes through Spring DispatcherServlet instead of Adobe MessageBrokerServlet. Now your code in the extension layer of the Clear Data Builder services can inject Spring managed beans, you can use Spring security to secure your services method-by-method based on Spring AOP and so on.

1) The Hibernate Query Language annotation is using the CompanyAssociate entity; mapping from entity to the table, between entity properties and table columns, is established inside the entity class
2) You can disable Spring support during the project creation wizard
clearwiki/20.cleardatabuilder/20.cleardatabuilder.txt · Last modified: 2012/02/17 11:32 by vrasputnis
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0