No, you're actually right... I just realized I made an awful signature with
two functions in a row and I'm puzzled John didn't notice it yet... quick
quick, to refactor it :P

The main problem I have with optionsFilter and the way it works is that I
still need a main function to select the correct transport. I thought about
associating a transport to one or more dataTypes but the thing is you have
priority issues (for instance you have to specify which transport has the
priority for jsonp between the script tag hack and the xhr ones). As it is
now, there is too much logic into the filters and the way they redirect to
other transports. With the goal of making the installation of a new
transport as painless as possible, I'm thinking about some override
possibility in addition to a pure install and maybe three functions (one to
confirm the transport is the correct one to use, one to pre-treat options
and the factory). As for the priority issue, I'm thinking about it but I'm
wondering if there wouldn't be something similar in another open-source
project, no matter the field of application and/or language: what
architecture is more suited to select the correct agent given a type and how
do you handle priority so that overriding your agents is easy?

2009/12/2 Scott Sauyet <scott.sau...@gmail.com>

> On Tue, Dec 1, 2009 at 8:21 PM, Julian Aubourg <aubourg.jul...@gmail.com>
> wrote:
> > Anyway, the code has been comitted at http://github.com/jaubourg/jquery
>
> Just started looking at this, and it makes a great deal of sense to
> me.  As to the extension API, would this be simpler?:
>
>    jQuery.transport.install("script", {
>        factory: function() { /* ... */ },
>        optionsFilter: function(s) { /* ... */) //optional
>    });
>
> It's a bit more explicit, at the cost, I guess of some additional
> bytes per transport (although it would save some in transport.js.)
> But I'm still trying to wrap my head around everything, and maybe I'm
> missing something fundamental.
>
>  -- Scott
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "jQuery Development" group.
> To post to this group, send email to jquery-...@googlegroups.com.
> To unsubscribe from this group, send email to
> jquery-dev+unsubscr...@googlegroups.com<jquery-dev%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/jquery-dev?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to