- 浏览: 16373 次
最新评论
The architecture of Flex and Java applications two (Flex 和 Java 应用程序架构 2)
2010年06月02日
Flex and Java applications use a multi-tier architecture where the presentation tier is the Flex application, the business or application tier is the Java EE server and code, and the data tier is the database. You can write the back-end code just as you normally would for a Java application, modeling your objects, defining your database, using an object-relational framework such as Hibernate or EJB 3, and writing the business logic to query and manipulate these objects. The business tier must be exposed for access via HTTP from the Flex application and will be used to move the data between the presentation and data tiers. Flex和Java应用程序使用一个多层架构,其中的表现层是在Flex应用程序,业务或应用层是Java EE服务器和代码,数据层是数据库。
你可以写后端代码就像一个Java应用程序通常会,建立对象模型,确定您的数据库,使用诸如Hibernate或EJB 3对象关系框架,编写业务逻辑去查询和操纵这些对象。业务层必须是通过HTTP公开访问的Flex应用程序,而且将被用于在表项层和数据层之间移动数据。
Typical HTML applications consist of multiple pages and as a user navigates between them, the application data must be passed along so the application itself (the collection of pages and functionality it consists of) can maintain state. In contrast, Flex applications, by nature, are stateful. A Flex application is embedded in a single HTML page that the user does not leave and is rendered by Flash Player. The Flex application can dynamically change views and send and retrieve data asynchronously to the server in the background, updating but never leaving the single application interface (see Figure 1) (similar to the functionality provided by the XMLHttpRequest API with JavaScript.)
典型的HTML应用程序包含多个页面,为用户之间的导航,应用程序的数据必须通过沿因此应用程序本身(该网页的集合和功能它包括)能够保持状态。相比之下,Flex应用程序,本质上是有状态的。一个Flex应用嵌入在一个HTML页面,该用户不离开,是由Flash Player的呈现。 Flex应用程序可以动态改变的显示页面,发送和检索数据异步在后台服务器,更新,但从来没有离开单一的应用程序接口(见图1)(类似于用JavaScript的XMLHttpRequest的API提供的功能。)
Figure 1. The client/server architecture. Flex applications can communicate with back-end servers using either direct socket connections or more commonly, through HTTP. The Flex framework has three remote procedure call APIs that communicate with a server over HTTP: HTTPService, WebService, and RemoteObject. All three wrap Flash Player's HTTP connectivity, which in turn, uses the browser's HTTP library. Flex applications cannot connect directly to a remote database. Flex应用程序可以与后端服务器通信,可以使用直接socket连接或更常见的服务器通过HTTP。 Flex框架有三个远程过程调用的API,通过HTTP与服务器通信:HTTPService,WebService,和RemoteObject。所有这三个包Flash播放器的HTTP连接,这反过来,使用浏览器的HTTP库。 Flex应用程序不能直接连接到远程数据库。
You use HTTPService to make HTTP requests to JSP or XML files, to RESTful web services, or to other server files that return text over HTTP. You specify the endpoint URL, listener functions (the callback functions to be invoked when the HTTPService request returns a successful or unsuccessful response), and a data type for the returned data (what type of data structure it should be translated into once received in the Flex application). You can specify the data to be handled as raw text and assigned to a String variable or converted to XML, E4X, or plain old ActionScript objects. If you get back JSON, you can use the Adobe Flex corelib package of classes to deserialize the JSON objects into ActionScript objects. To make calls to SOAP based web services, you can use the HTTPService API or the more specialized WebService API, which automatically handles the serialization and deserialization of SOAP formatted text to ActionScript data types and vice versa.
您可以使用HTTP服务,使HTTP请求到JSP或XML文件,以REST风格的Web服务,或到其他服务器上的文件通过HTTP返回文本。您指定的端点URL,监听功能(回调函数被调用时,HTTP服务请求返回成功或失败的反应),并为返回的数据(什么类型的数据结构应该成为一次收到的数据类型转换Flex应用程序)。您可以指定要处理的数据为原料文本和分配给一个字符串变量或转换到XML,E4X的,或普通的旧的ActionScript对象。如果你回来的JSON,您可以使用Adobe Flex的班corelib包反序列化到JSON对象的ActionScript对象。打电话到基于SOAP的Web服务,您可以使用HTTP API或更专门的WebService的API,它会自动处理的序列化和反序列化的SOAP格式的文本到ActionScript数据类型,反之亦然。
The third option for making remote procedure calls is to use the RemoteObject API. It makes a Flash Remoting request to a method of a server-side Java class that returns binary Action Message Format over HTTP. When possible, use Flash Remoting whose binary data transfer format enables applications to load data up to 10 times faster than with the more verbose, text-based formats such as XML, JSON, or SOAP (see Figure 2). To see a comparison of AMF to other text-based serialization technologies, see James Ward's Census RIA Benchmark application.
远程过程调用的第三种选择是使用RemoteObjectAPI。它使一个Flash Remoting的请求到一个服务器端Java类方法返回的二进制消息格式通过HTTP行动。如果可能,使用Flash Remoting的传输的二进制数据格式使应用程序来加载数据高达10倍的速度比更详细,如XML,JSON的,或SOAP基于文本的格式(参见图2)。要查看AMF的相对于其他基于文本序列化技术,
Figure 2. Methods for connecting Flex and Java.
发表评论
-
使用Flex实现FTP文件上传功能
2012-01-20 01:27 691使用Flex实现FTP文件上传功能 2011年04月12日 ... -
flex 打印 预览
2012-01-20 01:27 745flex 打印 预览 2011年03 ... -
在Flex Mobile中构建“本地”菜单
2012-01-20 01:27 893在Flex Mobile中构建“本地”菜单 2010年12月 ... -
Flex4中 一个使用Module的例子
2012-01-20 01:27 1048Flex4中 一个使用Module的例子 2011年02月2 ... -
python 常用类库!(转)
2012-01-19 09:17 2348python 常用类库!(转) 2011年01月21日 ... -
2011-10-10program
2012-01-19 09:17 6502011-10-10program 2011年10月10日 ... -
MFC对话框程序基础复习001
2012-01-19 09:17 681MFC对话框程序基础复习001 2011年04月23日 ... -
MFC----对话框(一)
2012-01-19 09:17 795MFC----对话框(一) 2011年0 ... -
vc++ 向其他进程注入代码的三种方法(转)
2012-01-19 09:17 957vc++ 向其他进程注入代码的三种方法(转) 2010年06 ... -
PRO/E配置文件选项
2012-01-17 01:50 838PRO/E配置文件选项 2010年08月08日 PRO/ ... -
一些工具集合
2012-01-17 01:50 729一些工具集合 2010年11月13日 【显示工具】 ... -
qt中文
2012-01-17 01:50 775qt中文 2011年06月09日 QDataStream ... -
装机必备检测软件全集
2012-01-17 01:50 797装机必备检测软件全集 ... -
3D MAX 常见小问题集合三
2012-01-17 01:50 7523D MAX 常见小问题集合三 ... -
FLEX做的网站
2012-01-15 21:01 625FLEX做的网站 2011年05月1 ... -
Flex开源项目网址列表
2012-01-15 21:01 713Flex开源项目网址列表 2011年06月19日 1. ... -
FLEX地图应用教程之一
2012-01-15 21:01 518FLEX地图应用教程之一 2 ... -
flex类网站收集
2012-01-15 21:01 534flex类网站收集 2010年10月22日 1. Fle ... -
用flex开发 google map应用程式
2012-01-15 21:01 760用flex开发 google map应用程式 2009年09 ...
相关推荐
The Architecture of Open Source Applications(开源软件架构),其中包含了中文和英文版,整理之后免费分享给大家,中文版由图灵社区翻译http://www.ituring.com.cn/minibook/19 本书是开源应用的必读资料之一,介绍...
《The Architecture of Open Source Applications》 是一本新推出的采用“知识共享署名3.0 Unported”许可证的程序设计图书,每一章节讲述了一种开源程序的设计,如Scalable WebArchitecture andDistributed Systems...
是一本新推出的采用“知识共享署名3.0 Unported”许可证的程序设计图书,每一章节讲述了一种开源程序的设计,如Audacity、CMake、Eclipse、Hadoop分布式文件 系统、LLVM、Mercurial、NoSQL生态系统、Python ...
The Architecture of Open Source Applications epub版本
The Architecture of Open Source Applications卷1 mobi格式
讲开源软件架构的书。 Contents Introduction Amy Brown and Greg Wilson ix 1. Asterisk Russell Bryant 1 2. Audacity James Crook 15 3. The Bourne-Again Shell Chet Ramey 29 4. Berkeley DB Margo Seltzer ...
此为 (中文版) AOSA官网: http://aosabook.org/en/index.html "500 Lines or Less", the fourth volume the AOSA series 1.The Architecture of Open Source Applications (volume1)
It focuses on the function and design of the various components necessary to process information digitally. We present computing systems as a series of layers, starting with low-level hardware and ...
几十款经典开源软件的介绍,通过阅读该书,能够在架构意识上有较大提升
The Architecture of Open Source Applications卷2 mobi格式
The Architecture of Open Source Applications 1.pdf
The Architecture of Open Source Applications (Volume 2)_ GDB 工具书
The perception and planning performances are improved with the help of two inner loops of simultaneous localization and mapping. An algorithm to enlarge the detection range of the sensors is proposed...
The Architecture of the Java Virtual Machine Data Types Word Size The Class Loader Subsystem Loading, Linking and Initialization The Primordial Class Loader Class Loader Objects Name Spaces ...
After two chapters on XML basics, including XPath, XSL, DTDs, and XML Schema, the rest of the book focuses on using XML from your Java applications. This third edition of Java and XML covers all major...
The absence of adequate facilities to design, optimise and interoperate new networks currently forces a convergence to an architecture that is suboptimal for many applications and that cannot support...
一本介绍开源软件项目系统架构的好书。epub无损格式。
This book is primarily intended for beginners who wants to learn various aspects of software engineering and building web applications using Java programming language. There are many good books ...
Understand the role and responsibilities of a Privacy Engineer for maintaining your privacy architecture Table of Contents Part I. Getting Started Chapter 1. What Is Privacy? Chapter 2. Personal Data ...