- 浏览: 40685 次
- 性别:
- 来自: 上海
最新评论
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.
发表评论
-
SQL Server2005截取字符串并操作
2012-07-06 09:51 615以前看过别人写的,但是实在记不起来是怎么写的了,今天自己写 ... -
用正则表达式验证密码强度
2012-07-06 09:45 764项目中有个需要验证密码强度,我对正则表达式并不熟悉,每次都 ... -
shell脚本系列-正则表达式介绍
2012-07-06 09:37 658正则表达式介绍 随着对UNIX和LINUX熟悉程度的不 ... -
Symbian 更换主题
2012-07-06 09:30 698http://wiki.forum.nokia.com/i ... -
JS 正则表达式各种验证
2012-07-05 20:45 710判断手机的: ... -
Android组件相关概念总结
2012-07-03 13:43 680Android 手机操作系 ... -
flex ant 例子
2012-07-02 10:31 504Flex Ant Task" def ... -
Flex之数据格式化
2012-07-02 10:31 618数据格式化是对某 ... -
flex 日期下拉框,选择一段日期
2012-07-02 10:31 609在一般网页的制作过程中,我们做的程序,日期选择框,通过js ... -
SWFAddress实现Flex深度链接(不同模块具有不同的URL)
2012-07-02 10:30 569众所周知,Flex明显区别于传统B/S开发模式的特性中,有 ... -
Adobe Flex Application LifeCycle
2012-07-01 00:09 566Flex的根对象就是Sys ... -
Flex4中 一个使用Module的例子
2012-07-01 00:09 598使用Flex的Module技术, 将各个业务子模块分散成若 ... -
flex linkbutton 数据加载
2012-07-01 00:09 752类似于导航条的一种。 flex/spark& ... -
Flex加载flash_as3_swf,并响应其中的按钮事件
2012-07-01 00:09 773注:flash_as3_swf里的源码里有一个btn_fu ...
相关推荐
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 ...