Python, CORBA, and Borland Java interop?

Dave Benjamin dave at 3dex.com
Fri Oct 11 14:33:21 EDT 2002


Alan Kennedy <alanmk at hotmail.com> wrote in message news:<3DA69C11.CC72C9CC at hotmail.com>...
> I have never met a python/java problem that jython couldn't solve. Have
> you considered jython, which is python implemented in java?
> 
> http://www.jython.org/
> 
> The boundaries between java classes and jython classes are completely
> seamless. To inherit into jython from a java class is simplicity itself,
> just use the java class as you would a jython class.

We have also considered this option, but we have an additional
constraint that prevents us from using Jython: We would like to
interoperate with Zope, which only runs on CPython.

We could wrap Java methods with something like XML-RPC or perhaps use
Python's pickling mechanism to serialize data between Jython and
CPython, but naturally this would introduce an additional layer of
complexity as well as reduce the efficiency we gain by using a binary
protocol like CORBA.

> So, presumably your IDL compiler is generating client stubs and server
> skeleton in Java? Simply use the java client stubs directly in jython:
> there should be no integration work or extra development work necessary.

Yes, I believe that is the case. This is all done transparently by the
AppServer normally. We used the java2idl program that ships with
AppServer to generate IDL files, which we then tried to interface with
Python. All of the IDL->Python conversion tools we tried choked on
things like this:

module CORBA {
  valuetype WStringValue wstring;
};

... and ...

module java {
  module lang {
    typedef any _Object;
    valuetype Class  {
    };
    valuetype Throwable  {
      private ::CORBA::WStringValue detailMessage;
      #pragma ID detailMessage
"RMI:java.lang.Throwable/detailMessage:0000000000000000"
<snip>

> Jython is very likely to be the perfect solution to your problem, if the
> JVM start-up time and memory requirements on the client side are not a
> problem.

I wish it were this simple. =)

> > The ability to do this would be a major asset to the company, as it
> > would free us to develop web front-ends in our language of choice! Any
> > help you could offer would be greatly appreciated.
> 
> I'm perplexed by this statement. What can python do in this regard that
> java cannot?

The primary concern is with rapid application development. We write
(and rewrite) new web interfaces frequently. Python's quick edit-run
cycle, healthy assortment of templating and text-manipulation tools,
and Zope's object publishing framework allow us to get this done
faster. In addition, the task of creating web interfaces is a job of
the web department, which prefers Zope in most cases, but the software
engineering department has considerable investment in the J2EE
architecture for the company's primary business processing needs.

Thank you for your reply!

Dave



More information about the Python-list mailing list