Flex Viewer 開發教程(7)Widget與伺服器互動

gispace發表於2011-05-15

 

本小節將不涉及具體的程式碼細節,因為Widget與伺服器的互動不會因為Flex Viewer的架構而有所不同,瞭解了Flex程式如何與伺服器端進行互動,直接應用到Widget中即可。下表是Flex與伺服器端進行互動可用的技術,具體細節可參考《Flex 4 in Action》中的第15章。

Communication

Server Support

Application

Benefits

HTTP

(includes REST and RPC hybrids)

  -All

Simple Widget-based applications; speed and real-time UI updates aren’t required.

Easy implementation via the HTTPService object; RPC hybrid protocols can be invoked using RemoteObject.

SOAP/WSDL

  -All

Data aggregation from external web services.

Easy implementation; pull data from multiple outside resources regardless of platform.

AML

  -BlazeDS&LiveCycle Data Services(LCDS):Java,

  -.NETZend: PHP

  -AMFPHP: PHP

  -WebOrb: .NET, Ruby, PHP

Approaching enterprise level; speed is important; data is usually pulled from server by polling.

Binary data compression makes communications 12 times faster; strong data typing; multiplatform support.

RTMP

  -LiveCycle Data Services(LCDS),

  -Flash Media Server(FMS)

Enterprise level, messaging, instantaneous UI updates; data can be pushed to the client; streaming media content; data intensive RIAs.

Integrates into existing J2EE infrastructure; document management, rapid data transfer, clustering, data tracking, syncing, paging, and conflict resolution.

Flash Remoting

  -Native to ColdFusion

Robust, enterprise platform for client/server Flex communications; native.

Seamless integration with the Flash platform; removes the need for an intermediate code library to do data type mapping and date serialization.

JSON

  -All (JavaScript data objects are serialized and transferred in binary form.)

AIR applications that use AJAX or Flex applications that use the ExternalInterface API.

Easy implementation with the HTTPService object; part of the AS3CorLib library.

相關文章