Andrew Borley wrote:
Hi all,
The implementation.python extension code is now checked in, alongside an
updated Calculator sample that allows you to substitute the current C++
implementation of DivideService for a Python one - see the Python
module in
samples/Calculator/CalculatorComposite/DivideServiceImpl.py and the
commented-out blocks in
samples/Calculator/CalculatorComposite/CalculatorComposite.composite.
It all
works on Windows and I've updated the Linux makefiles but haven't got a
working local Linux box to try them out on - could someone try a build
and
see what happens? For windows you need to have Python installed and the
PYTHON_HOME environment variable set to the installation dir. Also, I
only
have MS VC7, so I haven't updated the VC6 project files to include the
extension.
Andy, this is really cool!
A few issues came up when I was developing the extension:
1) The code currently depends on the CPP extension code, specifically for
the interface.cpp which is used by the extension just to get the scope
and
remotable attributes. Are these two attributes specific to C++
interfaces or
are they generic enough to be put into the tuscany::sca::model::Interface
super-class?
Yes, remotable should move to tuscany::sca::model::Interface.
I think that scope should stay in CPPInterface for now, and maybe move
to *Implementation classes later. IMO different implementation types
define different scoping rules (e.g. Java/C++ are probably similar, BPEL
would be different, a non OO language with no Class/Object may not
define scopes at all). I am not sure why scope is declared on the
interface at the moment, I'll investigate to see if it's consistent with
the spec or an oversight.
2) I wanted to use the exceptions in osoa/sca/ServiceRuntimeException but
they've been moved into the C++ extension, so I basically took a copy,
slightly changed it and put that in the Python extension. I wonder if
these
pretty generic exceptions should be in the SCA core instead of the C++
extension?
I thinlk that Pete mentioned this problem too. We need core Tuscany
exceptions, surfaced as osoa ServiceRuntimeExceptions in the CPP
extension, surfaced as something else for a different language binding.
3) Ditto with the use of the declarations in osoa/sca/export.h. Should
these
be in SCA core for anyone to re-use?
This is used in the SCA C++ API on Windows, do you really need it in
your extension? or are you just looking for cdecl export?
It was a pretty smooth ride to get this far, and it's pretty cool to
be able
to drop in some Python code instead of a C++ dll, or expose a bit of
Python
as a web-service :)
Yes this is really great, it should be easy now to build on top of what
you've done and integrate support for other scripting languages...
Next up is the bits identified in the "Extension matters" thread.
Cheers
Andy
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]