Mapping Python to CORBA

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Sep 25 16:55:13 EDT 2000


Andrew MacKeith <mackeith at hks.com> writes:

> I guess I had not expected _CORBA_ to have a reverse mapping, but I 
> thought that the Python community might have an opinion
> on such mappings, such as 
>     Python list -> IDL typedef sequence<any> MyList;
> or similar.

People normally don't create IDL from programming language artefacts,
but from application-level concepts. So you don't think in terms of
"list of tuples consisting of string and number", but "group of people
described with name and age". From that, you write the IDL

struct Person{
  string name;
  short age;
};

typedef sequence<Person> People;

Then, you arrange your Python code to fit the classes and structures
implied by that IDL.

ILU supports an enhanced "reverse" mapping for a special case:
Dictionaries map to a sequence of key/value pairs. It does not
actually generate the reverse mapping, though. Instead, it recognizes
sequences of structs with two fields name "key" and "value", and maps
them to a dictionary.

> However, I can easily work out my own, and as Tim pointed
> out, these things are probably very much application specific.

Indeed, they are. That is what the OMG domain technical committee is
about: come up with IDL definitions for interfaces that are useful in
a specific domain.

Regards,
Martin




More information about the Python-list mailing list