incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Mueller <pmue...@gmail.com>
Subject Re: [DISCUSSION] standard layer to exec : regCommandProxy
Date Thu, 23 Feb 2012 16:56:32 GMT
On Thu, Feb 23, 2012 at 10:18, Gord Tanner <gord@tinyhippos.com> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message