J2EE equivalent in Python

Graham Dumpleton grahamd at dscpl.com.au
Mon Oct 15 20:49:48 EDT 2001


gerhard.nospam at bigfoot.de (Gerhard Häring wrote in message news:<slrn9sdn54.227.gerhard.nospam at lilith.hqd-internal>...
> On 12 Oct 2001 11:51:36 +0100, Robin Smith <smithrc at zdbaora.nat.bt.com> wrote:
> >I like J2EE but I am also an open source fan. I don't like what I read
> >about Sun and restricting Java -
> >http://www.onjava.com/pub/a/onjava/2001/10/10/osjava.html .
> >
> >Is there anything similar to J2EE for python?

You might consider having a look at OSE. It embodies a number of features
which have parallels to what can be done in J2EE. Important thing to remember
with OSE though, is it is more the framework that underlies being able to
do such things, so don't expect a plugin solution which does exactly what
you want, you will need to build on it.

> Take the following with a grain of salt, my experiences with J2EE are
> limited to swearing because of incomprehensible error messages from
> Persistence Powertier ;-)
> 
> J2EE is a bunch of APIs thrown together, right? So we can examine the
> APIs one for one.
> 
> Servlets/JSP:   Python has a gazillion equivalents. There's a page that
>                 compares them all, but I don't have the URL atm.

OSE has a HTTP servlet framework with a mechanism for defining plugins as
to how to handle certain file types stored in the file system. Eg., allowing
one to define servlets written in Python in files stored in the file system.
In other words, much like what all the other systems can do. :-)

There is no JSP equivalent or other HTML templating system provided at the
moment, but research is being done on this in respect of what sort of
system is able to best make use of the features of OSE. It isn't that
difficult to use a system like Cheetah in conjunction with OSE servlets. 

> Distributed sytems: There are several ORBs. I like omniORBpy, for
>                     example. Then there are several SOAP
>                     implementations. And easy-to-use Python-only
>                     solutions like PyRO. And XML-RPC.

OSE has its own underlying distributed message oriented communications
framework, with an abstraction for representing service objects. Service
objects can communicate amongst themselves and servlets can be set up as
transient service objects so they can make calls to other service objects
as necessary. See examples at:

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81615
  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81614

The communications framework uses a model whereby each process in the
application is connected at all times, however, it is also possible to
create gateways for RPC over HTTP protocols such as XML-RPC and SOAP.
This allows remote clients to call direct into any exposed service objects.
See example at:

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81612

> JDBC:           Python DB-API 2.0.

In OSE it is relatively simple to encapsulate access to a database as a
service object and for that then to be accessible from anywhere in the
application or remote via XML-RPC or SOAP. See example at:

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81613

> Persistence (EJB): ZODB (included in ZOPE or available standalone).
> 
> Object-Relational Mapping (JDO): Not available AFAIK.

Don't really know what that does so don't know. :-)

> ZOPE probably comes closest to a J2EE server. It has something called
> ZEO if you need to scale up.
> 
> If you're adventurous, you can of course mix and match the APIs you
> like. And btw. there are also several ZOPE-light's: WebWare, SkunkWeb,
> Aquarium, ... I only tried WebWare and liked it.

As well as the above examples, there are various other examples on the
OSE web site. Also note that you aren't restricted to using just Python
with OSE, in fact its core is C++ and as such service objects can be
defined in C++ as well. Unfortunately, this use of C++ and the size of
the package seems to turn people off using it just for the Python
interfaces. :-(

OSE could in time be quite useful if a large library of reusable service
objects were available much like there are in the way of Java beans. This
would allow applications to be quite quickly put together. Right now though,
still in the process of getting Python developers actually interested in
the package.

Anyway, site for OSE is:

  http://ose.sourceforge.net

There are over 100 pages of hand written documentation for the Python
interfaces which can viewed on the site or as a PDF at:

  http://ose.sourceforge.net/python-manual.pdf

OSE is released as Open Source under the QPL.



More information about the Python-list mailing list