When defining an API, make it as simple and as obvious as possible what data is actually being passed across the API.
- This will make the API much easier to document - the names of the fields in the structures/objects/messages will be mnemonic, and you can document them as comments in the IDL file.
- You can use an IDL translator to convert from one IDL to another, like RPC to CORBA, or from one language to another, like C to Python
- You can automate the argument marshalling code if you want to write one or both sides of the API in another language.
HOWEVER, this API was aboslutely miserable to develop with, because you had to go deep into the code on both client and server sides to discover what the arguments being passed really were. We wanted to build a test framework to exercise a server, but we had to manually build the structures populate the arguments, instead of being able to build them automatically from the IDL files.
A counterexample is a typical RPC interface to C programs. It will have a number of structures defined in the .x file, and it's a small matter of programming to build, buy, or Google a program to parse the .x file and produce the other files to build a test scaffold from in the language of your choice.
Technorati Tags --
Software, SoftwareDevelopment, Computers, Programming
No comments:
Post a Comment