- 浏览: 42610 次
最新评论
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.
发表评论
-
“千年传承,再续辉煌”--广东阳江漠阳剑派
2014-10-31 00:33 1重剑无锋,大音希声,周星驰说折凳是最好的武器,我说看似嘻 ... -
数组、字符串
2012-07-06 09:51 7971 一维数组 数 ... -
java中正则表达式运用实例(用String类的matches方法演示)
2012-07-06 09:44 1779java中正则表达式运用实例(参看java中正则表达式运用 ... -
java 正则表达式
2012-07-06 09:37 742[b]Java [/b][b]正则表达式 [/b]在计算机 ... -
Flash CS5 用户自定义Button组件
2012-07-06 09:29 13302010/12/24 Flash CS5 用户自定义But ... -
自己写的自动完成js插件源码
2012-07-05 20:44 632经测试,此插件兼容ie,chrome,firefox。 / ... -
005_《Delphi6组件大全》
2012-07-03 13:42 1018Delphi 教程系列书籍 (005) 《Delphi6组 ... -
005_《Delphi6组件大全》
2012-07-03 12:16 603Delphi 教程系列书籍 (005) 《Delphi6组 ... -
关于flexigrid一点用法
2012-07-02 10:12 836闲来无事在网上找了一个jquery的grid插件 flex ... -
jsp页面
2012-07-02 10:12 716做人,生活,学习,玩.... ... -
Mate-基于标签的框架
2012-07-02 10:12 809Mate 将会成为Flex领域的另一个热点。它使用设置(c ... -
Flex中要想使图表的横坐标轴标签成45度显示(2)
2012-07-02 10:11 845从外部引入样式 1.在外部src/assets目录文 ... -
Flex获取操作XML示例
2012-07-01 09:32 703/****** ".",&qu ... -
Flex编程学习基础
2012-07-01 09:31 770Flex是Adobe公司推出 ... -
使用HTTPService读取远程XML文件为TREE赋值的例子
2012-07-01 09:31 728在FLEX4中 使用一个HTTPService 读取远程的 ... -
flex 通过HTTPService与php通信
2012-07-01 09:31 802最近研究HTTPService与php通信,去网上查了好多 ... -
解决Flex4 发布后访问 初始化极其缓慢的问题
2012-06-30 11:16 1391解决Flex4 发布后访问 初始化极其缓慢的问题 2011年 ... -
flex builder 3, flex builder 4下载与安装
2012-06-30 11:16 950flex builder 3, flex builder 4 ... -
Flex4之使用ActionScript构建组件
2012-06-30 11:16 580Flex4之使用ActionScript构 ... -
flex 开源项目组件大全
2012-06-30 11:16 1125flex 开源项目组件大全 2010年09月13日 Fl ...
相关推荐
The Architecture of Open Source Applications(开源软件架构),其中包含了中文和英文版,整理之后免费分享给大家,中文版由图灵社区翻译http://www.ituring.com.cn/minibook/19 本书是开源应用的必读资料之一,介绍...
The Architecture of Open Source Applications epub版本
《The Architecture of Open Source Applications》不仅是一本关于开源软件架构的技术书籍,它还提供了一种全新的学习方式——通过实际案例来理解和学习软件架构的最佳实践。对于希望提高自己架构设计能力的软件...
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)
The Architecture of Open Source Applications卷2 mobi格式
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...
以上是Java软件架构设计模式的一些核心概念和应用示例。通过理解和实践这些模式,开发者可以构建更加灵活、可扩展和易于维护的系统。在阅读《Software Architecture Design Patterns in Java》这本书时,每个章节都...
In these two books, the authors of four dozen open source applications explain how their software is structured, and why. What are each program's major components? How do they interact? And what did ...
一本介绍开源软件项目系统架构的好书。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 ...
Siva Prasad Reddy Spring is the most popular Java-based framework for building enterprise ...applications quickly and easily, and the inner workings of Spring Boot using easy-to-follow examples.
Java和Flex是两种在开发富互联网应用程序(RIA)时常用的技术。Java以其强大的后端处理能力和跨平台特性闻名,而Flex则是一种基于ActionScript的前端框架,用于构建交互性强、图形丰富的用户界面。两者结合,可以...