[KLUG Programming] Passing on variable argument lists.
Adam Williams
programming@kalamazoolinux.org
Mon, 9 Feb 2004 09:18:25 -0500 (EST)
>>From what I recall when writing stuff like this, not in-line, at least.
>If you're NOT screwed, you're VERY CLOSE to being screwed! :)
>You end up imposing a lot of requirements (perhaps impossible requirements)
>on users of this sort of API, since they AT LEAST have to provide a level
>of abstraction (like a function call level) between your stuff and whatever
>variable parm stuff THEY want to do..
>My 2 cents is that you would do well to program away all this variable length
>parameter list stuff if you can, but what do *I* know about your requirements?
Well, I think I'm just scrapping this idea; and thus giving up on thunking
out to another language to communicate with the server since the only way
to do it would seem to define a C call for every possible XML-RPC call -
alot of code. While that would be handy to someone, it doesn't do
anything for my needs; it certainly wouldn't be portable (since libwww
doesn't compile on vinblows) and would have to be jettison'd from the
final C# app anyway.
Mostly I just want to grab some data so I can create data objects (Task,
Account, Project, etc...) and test the interaction of my app.
So I've switched to the pulling the data down with python (whose XML-RPC
interface works VERY VERY VERY well, almost jaw-droppingly intuitive) and
writing it to a file. Then the C# app can load the file and create the
objects. Since "Server" is an object I already abstracted - there is
xmlRPCServer and cacheServer - this really doesn't cost me any extra code
- it just moves around what I wanted to write first.
cacheServer exists because I always wanted to have an off-line mode of
operation; just didn't figure I'd code it so soon. :)