|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Flash A New Solution for Flash Remoting
Integrating Flash clients with server-side components
By: Joe Orbman
May. 19, 2004 12:00 AM
If you do Flash Remoting in .NET - read on. We at MXDJ began to hear about FlashORB and went straight to the source for an inside view of this alternative to Macromedia's Flash Remoting. Everyone is talking about rich Internet applications. Some are experimenting; others are building real applications. Flash MX downloads are exceeding all expectations, and there is a general consensus that the Internet has evolved enough to take the user experience to the next level. With all the advancements on the client side, however, there has not been enough innovation on the server side. Macromedia has provided the initial set of the server-side technologies with Flash Remoting, but has not updated them since the initial release. The technology is still intrusive, noncohesive, and expensive. Many of these factors have influenced the creation of several alternatives to Flash Remoting. One of them, FlashORB, is reviewed in this article. FlashORB is essentially a Flash Messaging server, consisting of three major subsystems: Flash Remoting, Web Services Gateway, and XML Socket Server. Available in two editions (Java and .NET), the software provides a new way to integrate Flash clients with the server-side components (Java/.NET objects, EJBs, Web services, business applications). Architecturally the product is positioned between the client Flash UI and the server-side application; as a result, FlashORB addresses the needs of both UI and server component developers. For example, facilities within FlashORB like Call Tracing in the Management Console and the ActionScript code generator aid the UI team, while custom serializers, activation modes, and object factories help server-side developers. FlashORB nicely separates the responsibilities of the UI and the sever-side development teams. A Few Words About Flash Remoting The operation flow is very simple.
Now let's take a look at FlashORB as a remoting solution focusing on the main features differentiating it from the competing alternatives available in the marketplace. Each feature will be demonstrated with an example to clarify its use with actual code. For the simplicity and clarity, all of the examples use FlashORB.NET - the edition of the product for the Microsoft.NET environment; all the features discussed are also available in the Java edition. Type Adaptation The Flash side sends an untyped object to the server (line 10). When FlashORB receives such an object it tries to convert it into the formal argument type of the invoked method. All the fields from the untyped object are matched against the fields in the formal argument type. This process of converting data received from Flash clients into formal argument types is called "type adaptation." Although the example shown is rather primitive, FlashORB can easily convert even the most complicated data structures. It also works well with the built-in collection and utility classes. For example, an instance of ActionScript Array can be adapted to System.Collections.ArrayList or System.Collections.Stack or any other data structure where data is organized in a linear fashion. Security As you can see in Code V, without security restrictions in place it takes just a few lines of code to bring down the entire server. Therefore, securing Flash Remoting applications is of critical importance. Using FlashORB's configuration file or the management console, developers or administrators can restrict or grant access to the code identified by the package/namespace name or full class name. There are four types of restrictions that can be grouped together: restriction by role name, IP address, subnet address, or hostname. For example, to prevent the code above from working, FlashORB can be configured to reject access to java.lang.* for any requests arriving from clients whose IP addresses match the *.*.*.* pattern. Remote References Remote references are client-side proxies to server-side objects. On the server side a remote reference is created by developing a class that implements the Flashorb.IRemote (line 3) interface and providing a method that returns an instance of itself (line 9). The ActionScript code shown in Code VII demonstrates how to obtain a remote reference to an instance of the RemoteReferenceClass class and invoke its methods. A Flash Remoting service invokes a method on a server-side object (line 5). Since the method on the server side returns an instance of Flashorb.IRemote, FlashORB serializes it as a remote reference. The client side receives and caches the reference (lines 7-9) and then performs a remote method invocation via the remote reference object (line 11). This feature brings the UI and the server sides closer together and provides an extra level of sophistication for the client/server applications. Management Console XML Socket Server Call Tracing The FlashORB management console provides a graphical Call Tracing module to make this information easily accessible to developers. The module allows observing invocations in real time as well as browsing and searching the call trace store. Each invocation displayed in the module can be inspected to get the details about method argument values and the return value. Image II is a screenshot showing the Call Tracing module from the console. Conclusion Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||