Building web and desktop applications with BlazeDS and AMF

Source: Internet
Author: User
Tags web services port number

Whether it's a desktop application with Adobe AIR technology or a browser application with Flash Player, it's often necessary to connect to the server when you need to load or process the data. In the process of developing an application using Adobe Flex or Flash CS3, there are many options for how the application interacts with the server. The server itself, in addition to running some kind of server-side technology such as Java, ColdFusion,. Net, PHP, Ruby, must also have the ability to communicate on the network, either for applications running in Flash Player or for Adobe The client of the air application lays the groundwork for the interaction between the server side. Typically, the communication between the two is the HTTP protocol--the protocol used by web browsers to load Web pages and applications. However, using different data transmission methods under the HTTP protocol can bring about a difference in application performance and development efficiency.

Many applications running in Abode air or Flash Player use xml-over-http technology (such as soap, rest, etc.) to transfer data between the client and the server. This method is simple and easy to build. It is easy to apply XML to either server-side technology, because XML is a purely text-based protocol. XML is the perfect choice when transparent protocols must be implemented. For example, Flickr Web services use restful XML on top of HTTP transmissions. That way, whoever uses the technology can simply interact with Flickr by sending a simple text-based request to Flickr. Flickr's response is simple XML, and developers can easily parse the XML reply and use the data. The disadvantage of a text-based protocol like XML is that the extra data abstraction layer is relatively heavy to write and maintain. In addition, if the data needs to be serialized and deserialized, the data abstraction layer consumes a lot of resources on both the client and server side (see Figure 1).

Figure 1. AMF reduces marshaling of data layers

Flash player can support another transport protocol that relieves transmission bottlenecks caused by text-based protocols and can help developers interact with the server in a simpler way. This is the AMF (Action message Format). It is a binary format protocol that enables the exchange of data over HTTP protocols instead of text-based protocols for transferring XML. In the application of AMF, the data abstraction layer can be omitted completely, and the communication efficiency between client and server is much higher than that of the traditional text based protocol. Census RIA Benchmark applications can demonstrate the performance benefits of AMF.

In the past few years, a large number of open-source projects have been designed to provide AMF implementations that are similar to the one previously called Flash Remoting in Macromedia. Because of these open-source projects, developers of PHP, Java, and other technologies have been able to use AMF in their applications. When Flex version 1.0 is released, it covers the AMF-related features. Flex Release 2 also contains XML and AMF-related functionality, but server-side AMF-related features are specifically transferred to the Flex Data services new product. The Flex Data services were renamed to LiveCycle Data Services when integrated into the live cycle product family. LiveCycle Data Services ES Express for a single CPU server is free, but charges are high for products with multiple CPU servers, which makes it prohibitive for some developers to choose AMF. Some of them are therefore simply opting for some non-standard AMF implementations.

In the December 2007, Adobe made two big decisions, enabling everyone to use AMF. The first decision is to expose the AMF specification. After the specification is published, all projects will be able to implement AMF in accordance with specifications, without having to reverse engineer the protocol. Whether Back-end uses Java, ColdFusion, PHP,. Net, Ruby, or other technologies, the implementation of the AMF only needs to be compliant. Another decision is to open up some of the technologies in the Data Services es in the way blazeds projects are livecycle.

The blazeds contains the Java implementation of AMF, which can be used to remotely interact with Java objects on the server side, or to pass messages between clients. Developers can simply invoke Pojo, spring services, or EJB methods with the help of blazeds remote technology. Developers can send messages from the client to the server via their messaging system, and, of course, send messages from the server to the client side. BlazeDS can also be used in conjunction with other messaging systems, such as JMS, ActiveMQ. Because of the way in which remote technology and message systems are used to transmit AMF data on HTTP protocols, BlazeDS has a great advantage in performance and avoids the processing of additional data abstraction layers. BlazeDS works in many java-based application server environments, including Tomcat, WebSphere, WebLogic, JBoss, and ColdFusion. In addition, the use of blazeds is simple in flex applications, whether the Web (running in Flash Player) or the desktop (running under Adobe Air).

Developers can now download pre-release versions from the Adobe Labs site (http://labs.adobe.com/) (https://www.adobe.com/cfusion/entitlement/index.cfm? e= Labs_blazeds), deploy the Blazeds-samples.war file to any servlet container, and start your journey with blazeds development. This Web application package offers a number of preconfigured demonstration applications, all of which can be accessed by http://localhost:8080/blazeds-samples/(the port number is determined by the application server and server configuration you use).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.