6. Tide Data Framework

 Documentation Summary
 Page Summary

Introduction

The GDS/Tide project represents the Data Services part of GDS. It is comparable to LiveCycle Data Services, which is neither open source nor free, as it provides similar features such as client container of managed entities, data paging, and integration with server components, but it is based on completely different principles:

  • The client can work with strongly typed Hibernate/JPA detached objects, not object proxies or value objects, thanks to the support by GDS of lazy initialized entities and to the Gas3 generator.
  • All client/server interactions are done exclusively by method calls on services exposed by the server, and thus respect transaction boundaries and security defined by the remote services.
  • All managed entity instances are unique in a Tide context. That allows to correctly maintain data bindings between calls to remote services.

This is a very different approach than LCDS, which emphasizes querying and modification of data directly controlled by the client with commit/conflict reconciliation management. Tide keeps the classic three layers web architecture, when LCDS removes the service layer, and is some kind of remote JPA provider for Flex applications. Of course, choice is good and both approaches have their positive and negative points and might be used depending on the needs of your application.

Generally, the Tide approach is to minimize the amount of code needed to make things work between the client and the server. Its principles are very similar to the ones of JBoss Seam, which is the main reason why the first integration of Tide has been done with this framework. Integrations with Spring and EJB 3 are also available but are a little more limited.

Flex Classes & Sample Usage

To connect to your application, you will simply need to compile your MXML/AS sources with the granite-essentials.swc and granite.swc libraries.

Be careful that granite-essentials.swc must be linked with -include-libraries, the main granite.swc library can be linked in standard 'merged in code' mode

Here is a quick sample of a Tide usage with a HelloWorld component:

HelloWorld.as
public class HelloWorld {
    
    public function helloWorld():void {
(1)     var tideContext:Context = Seam.getInstance().getSeamContext();
        // var tideContext:Context = Spring.getInstance().getSpringContext();
        // var tideContext:Context = Ejb.getInstance().getEjbContext();
(2)     tideContext.helloWorld.sayHello("Jimi", helloResult);
    }

    private function helloResult(event:TideResultEvent):void {
(3)     Alert.show(event.result);
    }
}

(1) The first operation is to get the client context. This is the central part of the Tide integration as it encapsulates all communications with the server and all data management. Note that the Tide singleton is subclassed for each server technology (Seam, Spring and EJB).

(2) The context gives access to server components through their name. The tideContext.<component_name> automatically returns a client proxy to the remote component named <component_name>. The method call on this proxy is then sent to the server with the provided parameters. The last parameter is an optional function and will be used as a result handler when the response is received.

(3) The result handler is called with a TideResultEvent parameter, which gives access to the method call result.

This very simple example shows how easy it is to get started with Tide. The component calls are very similar to Seam remoting and you will be able to connect to your existing server application in no time.


Browse Space

- Pages
- Blog
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

Other Features

Add Content


Copyright © 2011 Granite Data Services S.A.S. All Rights Reserved.