Julius Chrobak
unread,Apr 9, 2012, 4:39:27 PM4/9/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bandicoot
Hello All,
This is a proposal for a new functionality. The idea is to be able to
retrieve signatures of all or a specific function in a structured form
from a running Bandicoot process. These signatures can for example be
valuable for applications which provide a dynamic UI to call Bandicoot
functions.
The proposed solution is to use the HTTP OPTIONS method on either the
"/" URI, the "*" URI or a specific function URI "/MyFunc". Independent
from the Request-URI the response body would provide the signature
details as a relation (i.e. standard CSV relation body) with the
following structure:
rel {
fname: string, # function name
method: string # either GET or POST
pidx: int, # parameter index: -1 - no params; 0 -
return; 1, 2, 3 … input parameters
prel: int # a flag 1/0 whether the parameter is a
part of a relational type or not
pname: string, # parameter name
ptype: string, # parameter type: int, real, long, string
}
Examples:
# function signature with no parameters
fn MyFunc()
# signature response
fname:string,method:string,pidx:int,prel:int,pname:string,ptype:string
MyFunc,GET,-1,0,,,
# function signature with primitive parameters only
fn MyFunc(param1: int, param2: real)
# signature response
fname:string,method:string,pidx:int,prel:int,pname:string,ptype:string
MyFunc,POST,1,0,param1,int
MyFunc,POST,2,0,param2,int
# function signature with mixed parameters
fn MyFunc(param1:int, param2: rel {a: int, b: long})
# signature response
fname:string,method:string,pidx:int,prel:int,pname:string,ptype:string
MyFunc,POST,1,0,param1,int
MyFunc,POST,2,1,a,int
MyFunc,POST,2,1,b,long
# function signature with mixed parameters and result type
fn MyFunc(param1: int, param2: rel {a: int, b: long}): rel {a: real}
# signature response
fname:string,method:string,pidx:int,prel:int,pname:string,ptype:string
MyFunc,POST,0,1,a,real
MyFunc,POST,1,0,param1,int
MyFunc,POST,2,1,a,int
MyFunc,POST,2,1,b,long
If the Request-URI is "/" or "*" the response body would contain
signatures of all available functions. If the Request-URI is a
specific function URI the response would only provide the signature of
the specified function or an empty response would be provided if the
function does not exists.
Feel free to comment on this proposal.
Regards,
Julius