graniteds.orgCommunity Documentation
The main value of GraniteDS is to provide integration with other frameworks, both client and server side, so there really are lots of different possible combinations of deployment types and usage scenarios. This chapter will describe various options, and common combinations of technologies.
There are two main use cases for the GraniteDS Java client. The first is to help testing of GraniteDS-enabled services outside of a Flex environment, the other is for building rich client applications with any Java view technology (Swing, SWT, JavaFX).
Note that the GraniteDS client library provides extensive support for most advanced features of JavaFX 2.1+.
There are also two main choices for the client/server API:
Use the low-level RemoteService API. This is the recommended API if you want to test existing GraniteDS services from a Java client, or do not need
advanced features.
Use the Tide remoting API with the GraniteDS/Tide server framework integration (supporting Spring, EJB3 and CDI). It provides the most advanced features and greatly simplifies asynchronous handling and client data management. It should be preferred for new projects, JavaFX clients or more generally when you want to benefit from all of GraniteDS functionalities.
The Tide remoting API and data management framework include a very minimalistic client application framework (event bus, component container...) and may be integrated with more robust frameworks such a Spring. There is a built-in Spring client integration, and a SPI can be implemented to integrate with other frameworks (Java client support for CDI may be added later).
On the server there are mostly two options :
If you use the RemoteService API, just choose the GraniteDS service factory depending on your server framework.
This will additionally bring you the GraniteDS support for externalization of lazily loaded JPA entities/collections, and support for scalable messaging though Gravity.
If you use the Tide API, choose the GraniteDS/Tide service factory for your server framework. This will bring the full feature set of Tide data management and further integration with data push through Gravity. The Tide server integration also provides more specific features depending on the server framework, for example complete support for Spring security or integration with CDI events.
This section describes some classic technology stacks used with Java applications and GraniteDS.
This is one of the most common use cases and allows for easy development and deployment. You can furthermore benefit from the extensive support for serialization of Java objects and JPA detached objects, and of NIO/APR asynchronous support of Tomcat 6.0.18+ or Jetty 6 continuations.
This is another common use case and it provides roughly the same features than Spring/JPA. The main difference is that it requires a full EE container supporting EJB 3.
This is an extension of the first case, with the additional use of the Tide remoting and data management API on the client. This will enable the most advanced features such as data paging, transparent lazy-loading of collections, real-time data synchronization... Tide also provides advanced client-side support for Spring Security authorization that for example allow to easily hide/disable buttons for unauthorized actions. This is currently the most popular technology stack.
It's also similar to the previous case, but using EJB 3 instead of Spring.
Well this is not really a "common" stack but at least it is a fully Java EE standard6. If you are on a Java EE 6 compliant application server and can live without Spring, it is definitely the best option.