Not yet rated

Problem

If you have ever used Hibernate, JPA or any other object-relational mapping (ORM) framework, you'll know that Session/EntityManager does all the hard work. However, there is no Session/EntityManger on the client side.

Solution

Athena Framework for Flex offers a Flex client side UnitOfWork that acts like Session/EntityManager. It help you track changes, load partial objects and resolve relationships.

Detailed explanation

Adobe Flex's test drive sample application does not show much about object management on the client side. We'll develop a similar sample application but with powerful object manipulation functionalities.

Sample App Screenshot

1. Download and install Athena Framework (open source, under the same license as BlazeDS) from http://www.athenasource.org/downloads/index.php?set=flex

2. Create a Java project as your server side ;

3. Create entities;

4. Create a Java service class:

public class EmpService extends AbstractService {
  ...
  public Object saveEmployee(Employee employee) {
    Object saveEmployee = doPerisist(employee, false);
    log.info("Employee saved: " + employee);
    return saveEmployee;
  }
}

5. Create a Flex project;

6. Generate ActionScript classes;

7. Use UnitOfWork to save multiple objects to the server side.

 

 

Detail of each step is available at http://www.athenasource.org/flex/basic-tutorial.php.

emp-dir-app.png
[Sample App Screenshot]

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes