[Orbit-python-list] Implementing proprietary extensions
Status: Inactive
Brought to you by:
tack
|
From: Jason T. <ta...@li...> - 2001-04-11 15:26:10
|
Right now ORBit-Python implements a few extensions, such as transparent
accessors (through __setattr__ and __getattr__). These extensions don't
really break the spec since they needn't be used at all. However
recently I've had a number of requests to implement coercion between
CORBA.Any and Python objects. This will obviously break the spec in
the case of CORBA.Any return values.
So I was wondering what the best approach would be to enable such
proprietary enhancements in ORBit-Python. I see 3 different "modes"
that would change the way the module behaves:
* strict: Enforce strict adherence to the mapping specification.
This will ensure compatibility with other specification-compliant
ORBs.
* extended: a superset of the strict mode. Features that extend the
specification, like transparent accessors or certain coercions,
become available. This would be the default mode
* enhanced: features that break the spec become available, like
coercing from CORBA.Any to Python objects.
The question becomes: what is the best way to select a mode? In some
cases, the mode changes the actual semantics of the code. Code between
enhanced and extended modes would work differently. Python 2.1 uses a
__future__ module that is used to enable things like nested scopes. My
inclination is to use a similar approach:
from ORBit import enhanced
or
from ORBit import strict
Any comments or thoughts on this approach?
Cheers,
Jason.
|