Yeah, that's a great idea. Kind of like the Command pattern with
handlers, right?
LT
--- In flexcoders@yahoogroups.com, Dmitri Girski [EMAIL PROTECTED]
wrote:
No worries.
BTW, there is another way of doing it - each request is represented
by
some object which creates HTTPService and
How about something like this:
(note: I've not tried it, just slapped it straight into the email)
public class MyClassThatInvokesHTTPServices {
//inner helper class.
class MyIResponder implements IResponder{
public var f:Function;
public var r:Function;
public
I like! This line says it all:
service.send().addResponder(new MyIResponder(resultB, faultB));
Thanks much. I think this is the solution.
It meets my requirements: no long conditionals; one-to-one matching of
service calls to fault/result handlers; reuse of the same service
object;
: [flexcoders] Re: Reusing HTTPService
I like! This line says it all:
service.send().addResponder(new MyIResponder(resultB, faultB));
Thanks much. I think this is the solution.
It meets my requirements: no long conditionals; one-to-one matching of
service calls to fault/result handlers; reuse of the same
Hi, Tracy.
Thanks for your response.
It's good to hear that others use this solution. Makes me feel like
it's not just a stop-gap hack.
However, what made me uncomfortable is the idea in OOP that classes
should be open to extension, closed to modification. It's generally a code
smell if one
Thanks, Dmitri.
This is a great idea. Unfortunately though, in this project, I don't
have control over what's returned by the server, so I can't add the
requestId.
But with your suggestion, you still end up needing to match requestIds
with handlers on the client right? So do you use a
No worries.
BTW, there is another way of doing it - each request is represented by
some object which creates HTTPService and subscribes for the response.
Because each instance sends single request, there is no problem to
decode the response.
Cheers,
Dmitri.
--- In
@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of lagos_tout
Sent: Thursday, October 16, 2008 2:26 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Reusing HTTPService
Hi, Tracy.
Thanks for your response.
It's good to hear that others use this solution. Makes me feel like
it's
If I were you, I would simply add the requestId into the server's
response, so client always knows which request-response pair it
handles. This idea lies behind most of the transmissions protocols.
Cheers,
Dmitri.
--- In flexcoders@yahoogroups.com, lagos_tout [EMAIL PROTECTED] wrote:
Hi,
9 matches
Mail list logo