2 Replies Latest reply on Sep 14, 2006 8:48 AM by dimival

    Question about DataService and Assembler

    dimival Level 1
      I know that in order to use a DataService you need an Assembler and an ActionScript class which is a mirror of the Java objects the Assembler will be working with.
      My question is, can the same Assembler work with two or more different Java objects??? For example:
      Suppose that you have class A and class B of Java objects, the fill method of the Assembler calls a Java method that returns a list which contains both, objects of class A and class B. On Flex you have also class A and class B, each one refering to its Java match.
      Does this work? can the DataService work like this, using two or more different kind of objects???
        • 1. Re: Question about DataService and Assembler
          jrunrandy Adobe Employee
          I think that you have a couple of options:
          * You can have different fill methods, some returning class A and some returning class B, although they'll have to have different signatures.
          * Remember that you also should have a Java Data Object. This (and the corresponding ActionScript data object) could have all your data.

          • 2. Re: Question about DataService and Assembler
            dimival Level 1
            Yeah i think i am going for option 2, because the list that Java returns contains up to 4 different kind of objects (hierarchy) so i would need the assembler and dataservice to be able to handle 4 type of objects at the same time and it seems this is not possible.
            I guess the only way to do this is like you said, with one generic Java and AS class which contains the data of the other 4 classes.