2 Replies Latest reply on May 25, 2010 7:26 AM by alejandrorrr

    Polymorphism and remoting

    alejandrorrr Level 1

      Hello everyone. I could not find if this was possible anywhere in the docs

       

      I have one class called:

       

      Question

       

      and i have Extented the class with concrete classes:

       

      BooleanQuestion, MultipleChoiceQuestion, NumericQuestion.

       

      Is it possible use the "abstract" class Question when Remoting via BlazeDS ?

       

      Thanks,

       

       

      Alejandro

        • 1. Re: Polymorphism and remoting
          Karl_Sigiscar_1971 Level 3

          There is no such thing as abstract classes in ActionScript.

           

          Either your classes implement an interface or they extend a superclass.

           

          If  you use an ActionScript superclass Question, you can map it to its Java counterpart with the [RemoteClass] metadata tag.

           

          I'm not sure what will happen if you send an abstract class.

          1 person found this helpful
          • 2. Re: Polymorphism and remoting
            alejandrorrr Level 1

            Karl, thanks for your reply.

             

            To be thorough:

             

            I was able to do remoting using an abstract class on the java (server) side. The problem is that when you use the new Data/Services option  the concrete classes are mapped without extending the abstract class (or "father" class on the AS3 side). So that breaks down the polymorphism.

             

            As you correctly pointed out, I have hand mapped the classes using [RemoteClass], but in order to use the generated services by the Data/Services Wizard you must modify them, so the hand mapped classes are used instead of the generated Classes (which don't extend the abstract class). This is a major issue since the "refresh" option for the services  is currently not working with BlazeDS Spring Integration/Hibernate.

             

             

            Again thank you!

             

             

            Alejandro