Loading ...
Sorry, an error occurred while loading the content.

Test code of my inheritance problem

Expand Messages
  • Ivan R. Judson
    Here s a small example that I think illustrates my problem. Any ideas? --Ivan test.zip
    Message 1 of 3 , Nov 2, 2001
    • 0 Attachment
      Here's a small example that I think illustrates my problem. Any ideas?

      --Ivan

      test.zip
    • Duncan Cameron
      Ivan I m not sure that I understand what the example is meant to be doing, as both of classes A and B are on each server, so no autodispatching will occur. To
      Message 2 of 3 , Nov 3, 2001
      • 0 Attachment
        Ivan

        I'm not sure that I understand what the example is meant to be doing, as both of classes A and B are on each server, so no autodispatching will occur.

        To return to your original problem, what you seem to want to do is implement remote inheritance through autodispatching
        i.e. class D has no event() or d_event() methods but wants to inherit them from class G which is on a different server.

        I don't see how Perl's way of inheritance is going to allow your model to work. Remember, that inheritance is dynamic, if class D doesn't have a event() method then Perl will look at all the parents of the class to try to find one. This means that the parent class, G, needs to be on the same server as D, not on a separate server.

        When Perl doesn't find an event() method then it will invoke the AUTOLOAD method in class D which is provided by SOAP::Lite. Autodispatching will then kick-in to send a request to the other server for the event() method for class D, not for class G. But now class D is on the wrong server.

        In fact even referring to a superclass's method doesn't work. If in class D you try something like
        $self->SUPER::event()

        then AUTOLOAD is passed the string 'D::SUPER::event' and then creates a request for method event in class D::SUPER.

        Can you explain your model a bit more clearly? If you've got something working then I'd be interested in seeing what you have done.

        Paul: what's your view on this?

        Regards,
        Duncan Cameron

        On 2001-11-02 Ivan R. Judson <judson@...> wrote:
        >Here's a small example that I think illustrates my problem. Any ideas?
        >
        >--Ivan
        >
        > test.zip
        >To unsubscribe from this group, send an email to:
        >soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • Ivan R. Judson
        Hey Duncan, Thanks for replying. Pretty much the scenario is like this: I have a little cluster, it can be 1-6 machines. Each machine has different
        Message 3 of 3 , Nov 5, 2001
        • 0 Attachment
          Hey Duncan,

          Thanks for replying. Pretty much the scenario is like this:

          I have a little cluster, it can be 1-6 machines. Each machine has different
          responsibilities, but very similar architecture. Each machine would be
          serving an object like B. However, some methods on B-like objects might
          need to invoke methods on other B-like objects on a different machine. All
          B-like objects are sub-classes of A, which abstracts the commonalities.

          I hope that makes some sense. I've been mulling over your response and
          think it might be time for me to reconsider autodispatch. I tend to like
          the simplicity and clarity, but I think it might be getting in the way for
          this problem.

          --Ivan

          > -----Original Message-----
          > From: Duncan Cameron [mailto:dcameron@...]
          > Sent: Saturday, November 03, 2001 11:18 AM
          > To: judson@...; soaplite@yahoogroups.com
          > Subject: Re: [soaplite] Test code of my inheritance problem
          >
          >
          > Ivan
          >
          > I'm not sure that I understand what the example is meant to be
          > doing, as both of classes A and B are on each server, so no
          > autodispatching will occur.
          >
          > To return to your original problem, what you seem to want to do
          > is implement remote inheritance through autodispatching
          > i.e. class D has no event() or d_event() methods but wants to
          > inherit them from class G which is on a different server.
          >
          > I don't see how Perl's way of inheritance is going to allow your
          > model to work. Remember, that inheritance is dynamic, if class D
          > doesn't have a event() method then Perl will look at all the
          > parents of the class to try to find one. This means that the
          > parent class, G, needs to be on the same server as D, not on a
          > separate server.
          >
          > When Perl doesn't find an event() method then it will invoke the
          > AUTOLOAD method in class D which is provided by SOAP::Lite.
          > Autodispatching will then kick-in to send a request to the other
          > server for the event() method for class D, not for class G. But
          > now class D is on the wrong server.
          >
          > In fact even referring to a superclass's method doesn't work. If
          > in class D you try something like
          > $self->SUPER::event()
          >
          > then AUTOLOAD is passed the string 'D::SUPER::event' and then
          > creates a request for method event in class D::SUPER.
          >
          > Can you explain your model a bit more clearly? If you've got
          > something working then I'd be interested in seeing what you have done.
          >
          > Paul: what's your view on this?
          >
          > Regards,
          > Duncan Cameron
          >
          > On 2001-11-02 Ivan R. Judson <judson@...> wrote:
          > >Here's a small example that I think illustrates my problem. Any ideas?
          > >
          > >--Ivan
          > >
          > > test.zip
          > >To unsubscribe from this group, send an email to:
          > >soaplite-unsubscribe@yahoogroups.com
          > >
          > >
          > >
          > >Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.