6 Replies Latest reply on Jul 25, 2006 11:43 AM by mike2281

    OO Flex Data

    mike2281 Level 1
      I want to call a web service and return a native AS 3.0 object representing something such as a person modify it, possibly move it to a different parent relation and save it back to the server.

      I will be creating a native AS object for each server objects, along with some light business logic and need to address several issues:

      1) Serialization XML or JSON into a native light object

      2) Relationships between objects in flex, currently using javascript I join the data on the client when initializing the app and loading child data and so on, this way each object is loaded once even if it has multiple parents in the client.

      3) Deserializing all changed objects and sending them back to the server.


      I see data binding examples that grab elements from xml but I can’t find any object serialization examples, if I have to write my own are there facilities that will help with this. Carnigorm is close to what I am looking for but the examples seem to rely on FDS and remote java classes.

      Any help is greatly appreciated…

      Thanks,

      Mike
        • 1. Re: OO Flex Data
          jrunrandy Adobe Employee
          • 2. Re: OO Flex Data
            mike2281 Level 1
            The docs were a big help,

            looking at the binary serialization example below is there an example or spec that will help me write the serialization on the server side using c# dotnet?

            public class Base implements IExternalizable {

            private var one:Boolean;

            public function writeExternal(output:IDataOutput):void {

            output.writeBoolean(one);
            }

            public function readExternal(input:IDataInput):void {

            one = input.readBoolean();
            }
            }
            • 3. Re: OO Flex Data
              mpeterson
              Hello Mike. I spoke with one of the Flex Data Service engineers about your question. You probably would not use the IExternalizable interface unless you are connecting to a Flex Data Services endpoint using something like the RemoteObject component. If you want to use WSDL / WebService, then you still must convert the types to strongly typed objects manually because Flex does not currently support automatic conversion.

              Currently, you'd need a way to create instances dynamically using flash.util.getDefinitionByName() and the new operator. You'd then loop over the anonymous objects returned from a service and populate the strongly typed instances.

              - Mike Peterson
              Adobe Flex documentation team

              • 4. Re: OO Flex Data
                mike2281 Level 1
                Thanks for checking into that,

                FDS is not an option right now and it's difficult to tell what code relies on FDS until I get to know the framework better, so for now it's roll my own. I just need to write my own serialization code or find a library I can use. If you have any existing code examples to manually serialize deserialize please post.

                Thanks,

                Mike
                • 5. Re: OO Flex Data
                  picmicro
                  Mike,
                  I have seen other of your post it seems that you are trying to integrate .net with Flex2 (me too).
                  If you are concerned about cost (like me) then FDS or WebOrb are out of equation.
                  Have you check flourine http://fluorine.thesilentgroup.com ?


                  • 6. Re: OO Flex Data
                    mike2281 Level 1
                    Excellent link, I will have a look.