Opened 16 years ago

Closed 16 years ago

#101 closed defect (wontfix)

Bind API refactor

Reported by: [email protected] Owned by: alex
Priority: high Milestone:
Component: General Version: 0.0
Keywords: Cc:
Blocked By: Blocking:


The bind API sucks. It's too swiss-army-chainsaw -- one function should never do so many different things based upon the input arguments.

At the least, the three major transport types should be separated into different APIs:

  • bindSyncRequest (e.g. synchronous XMLHTTP) - used to get one thing, and wait (good uses for this are limited and should be discouraged). Should Just Return The Response.
  • bindRequest (e.g. asynchronous XMLHTTP, IFRAME madness, etc.) - used to get one thing, asynchronously. Should return a Deferred.
  • bindTransport (e.g. pubsub, Flash XMLSocket, etc.) - used for a conversation with a server. Should return a Transport (which can be paired up with a Protocol).

Wiring up all the stuff like form posting, back/forward, blah should be done in other functions. It's totally orthogonal to I/O. You can have convenience functions that get stuff from a form, then do some I/O, but it shouldn't be so tightly bound to I/O.

Change History (3)

comment:1 Changed 16 years ago by dylan

I'm inclined to close this ticket, as I don't really agree with the premise (no offense intended Bob). Does anyone else think this is a necessary change?

comment:2 Changed 16 years ago by bill

I think you can close it. The form stuff _has_ been moved out to a separate code: the FormBind? class. And there is also a topic support, which is similar to the bindTransport comment, maybe. As for separating out sync and async into two separate functions, that might have been a better design but at this point I don't think it's worth it to change it.

comment:3 Changed 16 years ago by dylan

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.