GNU Info

Info Node: (python2.1-lib.info)Accessor Methods

(python2.1-lib.info)Accessor Methods


Prev: Type Mapping Up: Conformance
Enter node , (file) or (file)node

Accessor Methods
................

The mapping from OMG IDL to Python defines accessor functions for IDL
`attribute' declarations in much the way the Java mapping does.
Mapping the IDL declarations

     readonly attribute string someValue;
              attribute string anotherValue;

yeilds three accessor functions:  a "get" method for `someValue'
(`_get_someValue()'), and "get" and "set" methods for `anotherValue'
(`_get_anotherValue()' and `_set_anotherValue()').  The mapping, in
particular, does not require that the IDL attributes are accessible as
normal Python attributes:  `OBJECT.someValue' is _not_ required to
work, and may raise an `AttributeError'.

The Python DOM API, however, _does_ require that normal attribute
access work.  This means that the typical surrogates generated by
Python IDL compilers are not likely to work, and wrapper objects may be
needed on the client if the DOM objects are accessed via CORBA.  While
this does require some additional consideration for CORBA DOM clients,
the implementers with experience using DOM over CORBA from Python do
not consider this a problem.  Attributes that are declared `readonly'
may not restrict write access in all DOM implementations.

Additionally, the accessor functions are not required.  If provided,
they should take the form defined by the Python IDL mapping, but these
methods are considered unnecessary since the attributes are accessible
directly from Python.  "Set" accessors should never be provided for
`readonly' attributes.


automatically generated by info2www version 1.2.2.9