
66 Building a Flex Application
View states In many Rich Internet Applications, the interface changes based on the task
the user is performing. View states let you vary the contents and appearance of a component
or application by modifying its base content.
Transitions Transitions define how a change of view state appears on the screen. You define
a transition using the effect classes, in combination with several effects designed explicitly for
handling transitions.
For more information on controlling appearance, see Using Flex Builder 2 and Flex 2
Developer’s Guide.
Working with data services
Flex is designed to interact with several types of services that provide access to local and
remote server-side logic. For example, a Flex application can use AMF to connect to a web
service that uses the Simple Object Access Protocol (SOAP), an HTTP URL that returns
XML, or for Flex Data Services, a Java object that resides on the same application server as
Flex. The MXML components that provide data access are called data service components.
MXML includes the following types of data service components:
WebService Provides access to SOAP-based web services.
HTTPService Provides access to HTTP URLs that return data.
RemoteObject Provides access to Java objects (Java Beans, EJBs, POJOs) by using the
AMF protocol. This option is only available with Flex Data Services or Macromedia
ColdFusion MX 7.0.2.
How you choose to access data in your Flex application impacts performance. Because a Flex
application is cached on the browser after the first request, data access is responsible for
significantly affecting performance while the application runs. Flex provides several solutions
for data delivery to the client. It delivers data through runtime services that invoke Java classes
loaded in the Flex classpath, or sends proxy requests to web services or HTTP servers.
Using the WebService component enables you to use a SOAP-based approach, but it does not
always yield the best performance. Also, the additional XML with the SOAP encoding
requires more overhead than AMF does.
The performance of SOAP with web services is also dependent on your web services
implementation. Different application servers use different web service back ends, so you
might see performance differences depending on the implementation. The only way to
understand how well your implementation will perform is to load-test your services.
Comentários a estes Manuais