- From: Cameron McCormack <cam@mcc.id.au>
- Date: Mon, 21 May 2007 11:33:39 +1000
- To: public-webapi@w3.org
I’m starting to write some text for Bindings4DOM, and am wondering which direction to take for method overloading. OMG IDL does not support overloaded methods. XHR is currently written with IDL that assumes overloaded methods. Not all languages that such IDL is expected to target supports method overloading. The advantage of using an actual IDL (rather than just a description of the interfaces) is so that implementors can use tools can process them meaningfully. So, there are two solutions: 1. Break from OMG IDL, and define a “W3C IDL” that is OMG IDL plus method overloading. A way to compile the IDL to a language that doesn’t support overloading could be specified in this new language (e.g. giving alternative, unique method names). Advantage: ▪ Avoids hacking workarounds into the IDL to achieve overloading. Disadvantage: ▪ Existing OMG IDL tools now cannot be used on this IDL. 2. Keep OMG IDL, and use some compatible way to specify the overloading, such as using #pragmas just before the overloaded methods. Advantage: ▪ Existing OMG IDL tools can still be used on the IDL. Disadvantages: ▪ Specifying the overloading using #pragmas is a bit of a hack. ▪ The existing OMG IDL tools will only be useful for languages that do not support overloading, since those that do will require modifications to the tools to interpret the #pragmas. Implementors that use the IDL to generate code for the implementations: which would you prefer? -- Cameron McCormack, http://mcc.id.au/ xmpp:heycam@jabber.org ▪ ICQ 26955922 ▪ MSN cam@mcc.id.au
Received on Monday, 21 May 2007 01:34:13 UTC