4 Replies Latest reply on Nov 28, 2009 4:56 AM by Shivik

    About responders in Cairngorm


      Hello all


      I am confused here. I have seen some examples of cairngorm in action - login screens, posts in a blog etc.


      From what I have understood, I have got that all of my services will reside in the ServiceLocator mxml file. I have many service classes and I will create a RemoteObject for each of them, defining their methods inside the mx:RemoteObject tag using the mx:method tag.


      But what about responders? Should I create a separate responder for every method of the every service? Or 1 responder per service? Or just once responder - its not a Singleton so I think this option is not correct.


      Please guide me appropriately.


      Thanks and Regards


        • 1. Re: About responders in Cairngorm

          I think you should create one Responder-object for every service. So every call to the server will have its own Responder. I think (but I'm not sure) that if you have one responder for multiple services, that when you call multiple services subsequently, the same responder will fire, quite possibly giving you undesired behavior as you cannot control the order in which the services return their answers.


          So first sending a request to service1 and then to service2 does not guarantee that service1 will be the first to answer because all services are asynchronous.


          Therefore, a separate Responder object for every service, is what I would say.

          1 person found this helpful
          • 2. Re: About responders in Cairngorm
            Shivik Level 1

            Hello there


            One responder object for every service? That doesn't seem to fit in.


            In the command we create an instance of delegate and pass to it an instance of responder and after that a parituclar method of delegate is called.

            This method in turn calls the method of service on server - so in nutshell, it means that my responder is going to respond to the method of service residing on server.


            So doesn't that mean that I should create a responder for every method of my service? Or did I get something wrong here?


            Please guide me


            Thanks and Regards


            • 3. Re: About responders in Cairngorm
              BailHope Level 1

              You're right. I messed up my terminology. You have one responder for every method of your service. I was seeing a method as a service, if you get what I mean.


              That's what you get when you don't use Cairngorm for a few months. Sorry for the mixup!

              • 4. Re: About responders in Cairngorm
                Shivik Level 1

                No problem. That helped in clearing my doubt anyway.


                Thanks a lot


                With best regards