Sunday, August 17, 2008

Getting Started Project-GraniteDS with Spring,Hibernate and Cairngorm,part 1

I have been playing with flex for a couple of weeks now,and i am trying to use flex as the UI and keeping the backend in Java with as usal Spring,Hibernate stack.

So in this series i will create a getting started project(CRUD contact management) using Spring,Hibernate/MySQL,Cairngorm as the UI MVC framework,GraniteDS for remoting and Tomcat as the server . For now i will create an eclipse based project and later move that to maven. The base intention of this project is to setup a prototype with all the above technologies defined and explore all the aspects of GraniteDS features to serve as the POC for other developers if they are willing to try it.

There are few other similar example available on the web such as
but it's based on BlazeDS but i want to try and explore gas3 generator,hibernate lazy-loading support from GraniteDS,To know more about GraniteDS vs BlazeDS you can see http://
similarly is a very good open source project but i think they are using content repository.

Anyway these are the basic 3 steps that i'll cover
  1. Create a server, this will contain all the java code and configuration files for both backend stack and also graniteDS related configuration files.
  2. Create a flex client based on Cairngorm's framework, gas3 generator from GraniteDS for generating actionscript classes for corresponding hibernate POJOs
  3. Deploy and run this basic project using eclipse on Tomcat

And once this is complete i'll convert the same project to maven project, and eventually try more complex hibernate mappings to explore all the aspects of lazy-loading and AMF3 serialization/deserialization support provided by GraniteDS.

So lets get started, at first create a mysql database name sample_graniteds and table contact

create database sample_graniteds;
id bigint(20) not null auto_increment primary key,
name varchar(30),
email varchar(50)

In the next post i'll create a server project that contains all the business code as well as configuration files for flex rich client.


cheolho said...

besides gas3 , is there any other reasons to go with graniteds vs blazeds. Would it be possible to provide pros and cons, of each.

Puran said...

for me, one major advantage from GraniteDS is the hibernate lazy loading support,it's not there in BlazeDS. In one of my project we are using BlazeDS and DTOs or value objects to serialize/deserialize the data models, though it's a good practice to not to carry your hibernate entity to the client but still have to write lot of code,bit painful
also not sure if you have read this