Mapping Python to CORBA

Timothy Docker timd at macquarie.com.au
Thu Sep 21 19:17:31 EDT 2000


Andrew MacKeith <mackeith at hks.com> writes:

> Is there any standard for mapping standard Python
> types to CORBA IDL types?

No.

> I have read the CORBA Python Language Mapping spec,
> which describes how CORBA IDL types are mapped to 
> standard Python types.
> 
> The reverse mapping is not documented.  In some cases
> it is clear (such as string -> string, int -> long,
> float -> double), but for others (dictionary, list) it 
> looks as if I have to write my own interface.


In general CORBA does not specify reverse mappings from programming
languages to IDL. In most cases such a mapping would be so either too
limited or too complex to be useful. If you want to transfer
dictionaries containing values of arbitrary type, you need to be able
to map arbitrary python object to corba values and back again. How
would you deal with python class instances in the dictionary?

There are also tradeoffs that are application specific. For example,
in your case a dictionary might be passed as a sequence of key/value
pairs. But if the dictionaries are large enough you may want to use an
iterator pattern to reduce memory usage. 

All of these issues are easy enough if you write IDL for your own
application, but difficult/impossible to solve optimally in the
general case.

However, having said this, I think there is a reverse mapping for
(some parts of?) java, and there is also one for COM in the
COM<->CORBA interoperability specification.

Tim



More information about the Python-list mailing list