RIA (Rich Internet application)--rich Internet applications are increasingly widely used for their good customer experience, and there have been many successful cases in banking, telecommunications and other fields. Adobe's Flex is the most representative of the Flash based RIA technology. Through the integration of Flex and the current popular Spring and Hibernate Java EE Open source Framework, customers can achieve a first-class user experience, but also get the high stability, scalability and portability of Java EE applications. In a sense, RIA is the direction of future WEB applications. As a reader of this article, you should be familiar with the Java EE Development, Spring, Hibernate framework, and have some understanding of Flex and ActionScript.
Introduction
RIA (Rich Internet application)-rich Internet applications are a WEB application system that incorporates the functionality and features of traditional desktop application systems. RIA combines the benefits of fast and interactive desktop applications with features that are easy to deploy and maintain for traditional Web applications, providing users with more robust, richer web applications. Adobe Flex is the current popular Flash-based RIA Open source framework that enables you to create rich charts, 3D effects, animations, audio, and video using Flex's xml-based MXML, ActionScript, and SWC files (Flex component library) User interface, and all flex components will be compiled by the Flex compiler to generate SWF binaries to run in Flash Player.
Spring is a lightweight Java EE Open source application framework. Spring's plug-in architecture based on two core features of control inversion (inversion of control,ioc) and aspect-oriented programming (aspect-oriented PROGRAMMING,AOP) lowers the coupling between application components. With XML configuration files, the spring container can easily help you manage application components and dependencies between them, while spring also provides the transaction management framework, DAO support, integration to support the mainstream O/R Mapping Framework, and support for integration of various standard Java component Technologies (Ja Vamail/ejb/jms/web Service, etc.), support the integration of various view technologies (Web view and non-Web view).
Hibernate is a mature, full-featured, O/R Mapping (object/relational mapping) Open source framework on the Java platform. Hibernate is located in the data persistence layer in a layered Java EE architecture that encapsulates all data access details so that the business logic layer can focus on implementing business logic. Hibernate uses O/R Mapping to map objects in the object model to the Sql-based relational data model, and to implement the persistence of Java objects by using HQL (Hiberante Query Language), so that you can apply an object-oriented way of thinking to manipulate Vertical database. In addition, Hibernate O/R Mapping provides advanced features such as deferred loading and distributed caching, which can help shorten the development cycle and reduce development costs.
About the sample program
The sample program in this article is the more popular online pet store application scenario, divided into two parts:
Demo_client:flex project, mainly by the Flex implementation of user interface generation and response to user action processing.
Demo_central:java Web Project, which implements the business logic mainly by Spring, the read and write access control of the database by the Hibernate, and the remote object interface provided by BlazeDS to provide Flex access. The Jar packages that Spring, blazeds, and Hibernate rely on in this article are copied to Tomcat on the Webcontent/web-inf/lib directory of the Demo_central project.
Development environment
Eclipse 3.3.1.1
Web Tools Platform (WTP) for Eclipse
Adobe Flex Builder 3
Tomcat v6.0
MySQL v5.1
Integrated Flex and Spring
How can flex and Spring be integrated so that the flex front end communicates with the Java EE backend? Flex uses remote method calls and real-time communication technology to achieve asynchronous communication, flex communication protocols are mainly three: Httpservice, WebService and RemoteObject. The Romoteobject protocol, as the fastest way to communicate with Flex, uses the AMF (Action message Format) binary protocol to make it easy for the flex front end to interact with the Java EE backend via integrated blazeds, which is Flex The preferred communication protocol for integrating Spring.