free and more feature rich alternative to BlazeDS, but also outranks LCDS’ out-of-the-box features when it comes to data management, streaming media and integrating with mobile devices and Cloud computing
developer tools like code generation, invocation test drive and interoperability with multiple IDEs and frameworks
supporting integration with mobile clients (Android, Windows Phone 7, RIM Playbook and soon iOS) and the Java service layer, which includes support for Java POJOs, EJBs, Spring Beans, Grails controllers, Hibernate Objects and XML Web Services
An alternative is if you are using a generic DAO class to handle entity persistence is to put the enhanced populateTimestamp method on there and call it prior to inserting or updating the entity in the DAO
CDI managed beans. The @EJB annotation is removed and @Inject is used instead
Annotating the boundary (Cart) with the @Named annotation makes the Cart immediately visible for expression language (EL) expressions in JSP and JSF
@Named annotation takes the simple name of the annotated class, puts the first character in lowercase, and exposes it directly to the JSF pages (or JSP). The Cart bean can be accessed directly, without any backed or managed beans, by the JSF pages: <h:commandButton value="Check out!" action="#{cart.checkout}" />
If there is a need for abstraction, the class can be turned into an interface (or abstract class)
local implementation (with CDI events
@Inject
Event<String> event;
event.fire("Order proceeded!");
remote implementation:
javax.enterprise.event.Event belongs to the CDI-implementation
class Event can be considered to be a lightweight alternative to the java.beans.PropertyChangeSupport class
@Inject
Event<String> event;
event.fire("Order proceeded!");
event can be received by any managed bean and also by EJB beans
provide a method with a single @Observes annotated parameter
@Observes String event
there is no real event, just the payload:
The during attribute in the @Observes annotation allows you to select in which transactional phase the event gets delivered. The default setting is IN_PROGRESS, which causes an immediate event delivery regardless of the transaction outcome. The AFTER_SUCCESS configuration causes the delivery to occur only after successful transaction completion
Although CDI events work only inside a single process (in the default case, CDI is extensible), they are perfectly suitable for decoupling packages from modules
The method checkout() starts a transaction that gets "reused" by the OrderSystem and CustomerNotification session beans
Especially in the context of pagination, where the data is mostly retrieved for read-only purposes, database views are the easier and more efficient alternative. Instead of implementing a lot of plumbing on the “Java-side” all the work could be easily done in the database
Gas3 uses the principle of "Base" and customizable inherited classes that let you add methods to generated classes without facing the risk
of losing them when a new generation process is executed
5.3. Java Classes and Corresponding Templates
summary of templates used by the generator depending on the kind of Java class it encounters:
these templates are bundled in the granite-generator.jar archive, in the org.granite.generator.template
package and accessible as resources via the class loader
class: protocol is used because all standard templates are available in the classpath
Alternatively, you may use the file: protocol to load your template from the filesystem. These templates can be
specified either by using absolute paths (eg. file:/absolute/path/to/mytemplate.gsp) or paths relative to your
current Eclipse project root directory (eg. path/to/mytemplate.gsp).
ActionScript 3 generator is able to write AS3 typed client proxies for exposed remote services
Compared to the usual Flex RemoteObject, this can greatly help development by bringing
auto-completion
improved type-safety
in Flex
when using remote services.
replicate validation annotations in order to use the Flex side validation framework
Known Limitations
Gas3 does not support inner classes
must declare your classes in separated source files
if you want them to be correctly handled by the generator
JPA applications that create an EntityManagerFactory on their own, either using the PersistenceProvider SPI directly or through an intermediary mechanism such as Spring's LocalContainerEntityManagerFactoryBean
standard Java EE-applications may ignore the provider implementation and rely on the standard features provided by the container - JBoss AS7 supporting standard JPA 1.0 and 2.0
future versions of JBoss AS7 it will be possible to use alternative persistence provider implementations