[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Flash MX 2004 with an Atom WSDL file
Randy Charles Morin wrote:
> Quote
> http://www.franklinmint.fm/blog/archives/000118.html
> There's been some debate on Atom-Syntax about the choice of SOAP as
> fallback for platforms that don't support the full set of HTTP verbs.
> There's also a proposal on the wiki to use a homegrown protocol. I
> think that would be a terrible mistake, given the amount of existing
> SOAP support.
Although lately I've been focused on other technologies and programming
languages, I've worked with Flash development for 3 years and it's still
part of some of my possible new projects. So, yeah, a SOAP alternative
for Atom is very interesting to me, but I must also say that I *hate*
SOAP. Allow me to elaborate:
XML processing in Flash is *slow*. Most of my target audience, here in
Brazil, is still using inferior machines, say, 500Mhz PCs. And even
simple applications that use the latest Flash UI components are
unbearably slow. This has a major concern for me. The fact is that the
Flash Player is quite an impressive work, and if we use it correctly, we
can produce very nice applications with an incredibly small footprint.
This is totally achievable, but not with the standard Macromedia
components, which are, to say the least, somewhat bloated. There's an
upcoming update who will prolly fix most of the current issues, but
until then, I'm forced to think about all the alternatives.
I'd not use SOAP in a Flash application. It'd consume way too much
processor cycles to parse the verbose XML file. Instead, I'd use a
tecnology that was introduced in Flash Player 6, Flash Remoting.
Flash Remoting is a binary data transfer format, which enables most of
RPC features. I'm not very good with these technical terms, I know very
little about the concepts behind RPC, but basically, in Flash Remoting,
you can set up an object, and when you call a method:
var callback = {
onResult:function(returnData) {
trace(returnData);
}
}
var conn = NetServices.createGatewayConnection(url);
var remoteService = conn.getService("webservice", callback);
remoteService.someMethod();
The Flash Player sends a binary packet to the server. There's a need for
a special server, called Flash Remoting connector, which does the (I
hate this term) unmarshalling of data. Macromedia has its own Flash
Remoting implementation, which is free for ColdFusion server owners, and
paid for those willing to use it with .NET or J2EE.
But there are opensource implementations of Flash Remoting, such as
AMFPHP (amfphp.org) and OpenAMF (www.openamf.org). AMF stands for Action
Message Format, which is Macromedia's proprietary data forma used in
Flash Remoting. Yes, 'proprietary', and that sucks, and it gives no
confidence to use the technology.
But the point is that if you want a fast and reliable Flash application,
you'll want to use Flash Remoting, and a lot of people have been using
these alternative options, such as AMFPHP. I myself am developing a
Python implementation of Flash Remoting in Python.
I've been doing a lot of experiments, and I'm feeling that it may be a
good idea to send pure Atom XML data (no SOAP) through Flash Remoting.
At least, this is how I'd implement it right now if I needed to.
Anyway, I'm still studying this carefully, and I plan to open a page on
the wiki soon with some practical info for anyone willing to implement a
Atom client in Flash.
\\ jonas galvez
// jonasgalvez.com