<self_promotion> I may have written a javascript aspecting library before ;)
https://github.com/gtanner/twill </self_promotion> On Thu, Feb 23, 2012 at 11:56 AM, Patrick Mueller <[email protected]> wrote: > On Thu, Feb 23, 2012 at 10:18, Gord Tanner <[email protected]> wrote: > > > I am wondering if we should build proxying directly into the exec module. > > This would require a generic exec module we would mix in from that would > > do this for us but I am thinking: > > > > var exec = require('cordova/exec'); > > > > exec.proxy("service", "action", function (success, fail, args) {}); > > > > I think all the styles currently mentioned allow you to override an exec() > call, but don't actually allow you to "augment" an exec() call. Maybe > that's just not needed. But the idea is, what if I need to do a little > something special before/after/both an exec() call? How do I invoke the > original exec()? eg, a "super" call. Or aspect-y before/after advice. > > > > I would expect the platform init code to have some way of linking up > these > > proxies. I would prefer it to be handled via convention over > > configuration, for example via folder structure or file name. > > > > Yes, convention over configuration. Convention that is interpreted by the > stack and executes against an "API". Not public API (yet). Most uses > would just use the convention, but the API is there if you need it, for > some reason. > > > > lib/exec/blackberry/proxy/contacts.search.js > > > Drew mentioned whether we should hook at the service or service/action > level. I assume this example is service/action. I think for "convention", > this will be unwieldy if I have a bunch of actions in a service. Seems > like "service" is a better fit for "files/modules". > > And if those proxies are modules (of course), then the proxy module can > just export each action as a property/value (function) on the module. > > -- > Patrick Mueller > http://muellerware.org > -- Gord Tanner Senior Developer / Code Poet tinyHippos Inc. @tinyhippos
