12 Replies Latest reply on Nov 11, 2008 1:05 PM by Peter Lorent

    flex remoting and data conversion

    drenner1
      i have a current app .... it uses a web service to pull data .... returns the data as XML and then the data is converted to an arraycollection for use in various datagrid dataproviders ..... bottleneck in app appears to be converting all data from xml to arraycollection .... approx 5 minutes to process 3000 rows before data appears in app .... so want to use remoting to improve app performance ...

      my question is: when I use remoting and return data to client via remoting, can I use the data immediately without having to do a 'conversion' step as the app is currently doing ??? can the data returned via remoting immediately be processed as an array (for example, looping over array elements) so it can be 'partitioned' for use for the various datagrids?? or do I still have to do some sort of conversion like I am currently doing ??? if I can immediately 'use' the data returned from the remote object without having to do a conversion step, I am thinking this will increase performace dramatically ....

      thank you very much
        • 1. Re: flex remoting and data conversion
          Level 7

          "drenner1" <webforumsuser@macromedia.com> wrote in message
          news:gf9j2f$901$1@forums.macromedia.com...
          >i have a current app .... it uses a web service to pull data .... returns
          >the
          > data as XML and then the data is converted to an arraycollection for use
          > in
          > various datagrid dataproviders ..... bottleneck in app appears to be
          > converting all data from xml to arraycollection .... approx 5 minutes to
          > process 3000 rows before data appears in app .... so want to use remoting
          > to
          > improve app performance ...
          >
          > my question is: when I use remoting and return data to client via
          > remoting,
          > can I use the data immediately without having to do a 'conversion' step as
          > the
          > app is currently doing ??? can the data returned via remoting immediately
          > be
          > processed as an array (for example, looping over array elements) so it can
          > be
          > 'partitioned' for use for the various datagrids?? or do I still have to do
          > some
          > sort of conversion like I am currently doing ??? if I can immediately
          > 'use' the
          > data returned from the remote object without having to do a conversion
          > step, I
          > am thinking this will increase performace dramatically ....

          Try using an XMLListCollection.


          • 2. Re: flex remoting and data conversion
            drenner1 Level 1
            amy ... thanks for your response ... could you please elaborate a little more ..... somewhat new to flex, etc ..... are you implying that no data 'conversion' needs to take place in the case where the data is returned as XML ??? simply iterate over the returned data as an xmllistcollection thereby relieving the bottleneck of the conversion from xml to araycollection ??? how is xmllistcollection 'created' from the returned xml data or is it ??? also any particularly good refs showing examples of this concept would be appreciated .....

            thanks so much ....
            • 3. Re: flex remoting and data conversion
              Level 7

              "drenner1" <webforumsuser@macromedia.com> wrote in message
              news:gf9ng2$ep1$1@forums.macromedia.com...
              > amy ... thanks for your response ... could you please elaborate a little
              > more
              > ..... somewhat new to flex, etc ..... are you implying that no data
              > 'conversion' needs to take place in the case where the data is returned as
              > XML
              > ??? simply iterate over the returned data as an xmllistcollection thereby
              > relieving the bottleneck of the conversion from xml to araycollection ???
              > how
              > is xmllistcollection 'created' from the returned xml data or is it ???
              > also any
              > particularly good refs showing examples of this concept would be
              > appreciated
              > .....
              >
              > thanks so much ....

              There's no iteration necessary. I don't think I could give you nearly the
              depth and quality of information you'd find by searching "XMLListCollection"
              in the Help. I find this setup most useful for getting what I need when I
              need it from the help:
              http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html


              • 4. Re: flex remoting and data conversion
                chris.huston.t10 Level 3
                One possible advantage to remoting is that your data will be transmitted in binary form whereas XML is transmitted as a string. Thus, remoting bandwidth requirements are considerably less, making transfer speeds significantly faster with remoting. Also, the data is transmitted in a format that is native to Flex (such as ArrayCollections), so no conversion is required. I wonder if part of your 5 minute delay comes from this transmission time or if it is all from your loop to convert the XML to an ArrayCollection. Although the XMLListCollection might get rid of your bottleneck, remoting could help out if your data sets get larger or more complex. I have been using amfphp and have had very good results. If you have the option of using remoting, I would certainly look into switching. Although the initial setup is a bit more involved, it has saved me and my users time down the road.

                Vygo
                • 5. Re: flex remoting and data conversion
                  *gsb* Level 1
                  @drenner1

                  " One possible advantage to remoting is that your data will be transmitted in binary form whereas XML is transmitted as a string. Thus, remoting bandwidth requirements are considerably less, making transfer speeds significantly faster with remoting."

                  ...true enough, true enough. I made a small example using XML and a 3000 record data set is some 600K.

                  But the processing time of the data set as an XMLListCollection is very small, close to instantaneous on this old machine. I made you a link; right-click for the source: Example Link

                  I added a filter function to filter the 3000 records to show only the unique employees, ...or not.



                  • 6. Re: flex remoting and data conversion
                    Peter Lorent Level 2
                    In addition to the binary format, remoting enables you to return a collection of typed objects. So, let's assume you are working with Product objects, using remoting an automatic conversion is done so you receive a collection of Product objects. This enables you to work directly with those objects instead of working with a generic collection. Personally, I don't do anything anymore without remoting.
                    • 7. Re: flex remoting and data conversion
                      drenner1 Level 1
                      greg:

                      would you be so kind as to send the source code (as & mxml) for this example ???

                      thank you very much

                      dave .....
                      • 8. Re: flex remoting and data conversion
                        drenner1 Level 1
                        luigi:

                        I will be working with vb .net & weborb or flourine on the server side for the remoting implementation .... do you have any experience as to which of these technologies is better ??? i have looked on the web for some real comprehensive examples of .net remoting but am only getting bits and pieces here and there ..... do you know where I can get a real good step by step example of implementing .net remoting with either weborb or flourine ???

                        thanks so much
                        • 9. Re: flex remoting and data conversion
                          *gsb* Level 1

                          @drenner1

                          The zip file is at the bottom of the "Source View."
                          Simply right-click on the example and you can '"see" and download the source.

                          If you have trouble, sure I can email it to you, is like a 9K file.

                          • 10. Re: flex remoting and data conversion
                            drenner1 Level 1
                            greg:

                            sorry about that ... got it .... thank you

                            dave .....
                            • 11. Re: flex remoting and data conversion
                              *gsb* Level 1

                              U R welcome.

                              Let me know if that does not help you solve the "conversion" delay.

                              Remember, as other have said, remoting may be a better way in the long run, but this is the easiest way, I think.

                              • 12. Re: flex remoting and data conversion
                                Peter Lorent Level 2
                                I use WebORB for several technologies and I like the product very much. They also have a lot of examples for the .net implementation. I don't have experience with flourine and I don't know if it supports rtmp.