4 Replies Latest reply on May 28, 2007 7:10 AM by Gorka Ludlow

    Web application best practice...

    najh
      I'm creating a web site with heaps of Flash stuff on it. I'd like it to load plenty of information from a database server and save plenty of information back again. It's not a vast amount of information by the way - i don't need to load video clips and things, but there will be loads of different flash resources on the site and so plenty of different occasions when there'll need to be some loading and saving going on.

      So to the question - what's best to use?

      1) LoadVars? (or XML Object) - I'm pegging this option together as I can see that loading some of the info in XML format from say an ASP page could be a good idea

      2) Web services? I don't know much about webservices, but plenty of big companies seem to be offering them out - google, yahoo and flickr for example (- but dya reckon they use them themselves?) I realise i'd have to learn something a bit different like .net (so maybe VB.net or c# or something any opinions about which to go for there too??) or maybe perl or python or something...

      3) Flash Remoting? I have bad feelings about this one - i don't want to pay for extra stuff if it doesn't do much for me - and i understand that with this one i'll still need my server side application anyway - so it makes me wonder what the point is? And I've also heard that the latest flash version doesn't really support it very welll.....

      So does anyone have any thoughts? I'd love to hear some opinions... I DO care about performance and I DO care about how fussy and complicated the programming will be. My gut reaction is that web services are the way to go, because to my naive mind they seem like they'll be simpler to code and potentially have less bugs and therefore be more reliable. But then I'm not trusting my naive mind, I'm asking you clever forum types instead!

      Best Wishes,
      Neil
        • 1. Re: Web application best practice...
          Greg Dove Level 4
          I don't think I can offer any definitive advice. Partly because it should be based on what your requirements are longer term I guess, and (probably mostly) because I don't know that much about it myself. I'll share what little I know.

          For flash, in terms of my understanding remoting is the fastest/most efficient means of communicating with a service you expose on your server , and I'd assume its more scalable as an approach longer term. There's the Adobe versions with Coldfusion and, I think .net, but there are open source options e.g. AMFPHP as well. I think that CS3/as3 will ultimately have no problems with remoting - I read somewhere that although the remoting components are not there now, flash cs3 can use flex non-visual components and also somewhere else that the remoting components are not necessary for remoting to be possible (but I guess they make it easier). I have no idea whether either is true, but I'd be surprised if long term flash cs3 can't do remoting as well as previous versions. The amf encoding method that is used for remoting is more readily accessible in as3 I think, so I can't see it being a problem.

          There's another framework for a type of remoting based on what I assume is some form of XML serialisation called XMLPC , but I don't know much about it.

          Both flash remoting and XMLRPC give you the ability to not worry about how the data is translated and transferred between flash client and server. You just deal with it in the native data structures in a similar way to making function/method calls locally. LoadVars is great if you just want to transfer name value pairs...eg sets of variables, XML is great for transferring structured representation of data. I've become more accustomed to working with XML as it is and using it as a the basis for my data in flash when I need to use it, which saves having customer encoding/decoding functions to change the way its dealt with locally. This is not always possible or convenient... but with XPathAPI in as2 it is a little easier, and I'm looking forward to using the new CS3 xml representation.

          LoadVars and XML are also great and if you're starting out, and are probably essential in terms of having them as an option anyhow so may not be a bad option to begin with just so you're familiar with them. I would suggest that you always know how to work with these approaches and maybe they'll be enough for you for now anyway .

          I know nothing about SOAP or any other type of webservice.

          Don't know if that helps.

          • 2. Re: Web application best practice...
            najh Level 1
            That's most helpful to hear your views. To be honest I've dabbled a little with the LoadVars and XML Object and I've developed some "ASP Classic" (as I believe they call it now) pages which manage to send some data to and from flash and to and from a SQL Server. It doesn't feel elegant - in fact it feels a bit of a hideous mess and I fear how well this approach might work when I have 30 or 40 similar flash files, presumably all speaking to a similar number of asp pages just to get the communication happening properly. I think that's the moment I started wondering if the Remoting and Web Services options were a better alternative.

            I really appreciate your views GWD. Does anyone else have some opinions on SOAP / other types of web service so that I can take these on board?
            • 3. Re: Web application best practice...
              Greg Dove Level 4
              FYI here's some Flash remoting as3 info:

              http://blog.vixiom.com/2007/04/17/actionscript-20-flash-remoting-with-flash-cs3

              Also something that might be considered "official" - [perhaps] from adobe at the end of this thread about remoting components:
              http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid =1262046&highlight_key=y&keyword1=accordian
              • 4. Re: Web application best practice...
                Gorka Ludlow Level 1
                I'd say webservices is the way to go. I use them for a couple of reasons:

                1.- It follows the MVC framework. I usually have two versions of my sites (Flash and HTML) and it is easier to bring data from one source instead of several sources for each development.
                2.- If I ever need to upgrade the View part of the proejct or change anything withing the business logic the webservice approach makes it easier for you.

                If you use Flash Remoting or ASP Classics you end up with a solution that only works for itself. Webservices are the way to go if your projecto needs scalability.

                Cheers
                Gorka