About Flash Remoting
15
Once the application server or web service satisfies the service request, it returns the result to Flash
Remoting, which in turn encapsulates the data in an ActionScript object, and returns it as an
AMF message to the Flash application. In this example, the available seats are returned as a record
set that lists the section, row, seat, and ticket price for each of the available seats.
The Flash Remoting architecture facilitates the flow of messages between the client and server
in a way that conforms to established design patterns and frameworks such as the
model-view-controller (MVC) architecture. The following figure depicts the MVC architecture
in the context of Flash Remoting:
In the MVC architecture, the model, view, and controller have the following roles:
•
Model
The model represents the data of an application and the processing of that data and
other logic. In a web application, this typically consists of the application server program and
the database.
•
View
The view represents the user interface, which usually consists of user controls and
information display.
•
Controller
The controller represents the logic that handles user input and changes the model
or view accordingly. Depending on your application design, the controller can be located on
the client, the server, or a combination of both. To minimize the amount of network traffic
and to take advantage of the Flash runtime, Flash Remoting implements the controller
in Flash.
Flash Remoting MX enables the separation of the controller from the model by providing a
communication channel between Flash applications and application servers or web services. By
encapsulating the data in an ActionScript object, Flash Remoting reduces the number of service
requests necessary to retrieve smaller pieces of data.