Thursday, July 9, 2009

Django AMF Service

Now that the basic Django framework is in place (admin, views, urls), the focus shifts to data and services. In the past, WebORB has been adept at providing RPC between ASP and RIA, so it's tempting to use it again in a Linux environment.

Since the current project is Apache, one option is to utilize Apache Tomcat. Tomcat is readily available in MediaTemple's (dv) configuration to provide a pure Java HTTP server environment. This would pair well with WebORB for Java, a robust middleware solution for RIA data synchronization.

Good enough but the tiers don't fully align with the planets yet. My goal is to utilize remote procedure calls to mySQL and take advantage of the schema I've built in Python-based Django. That will not be possible until my Python objects can be called from Java. So, is it possible to port Python code to WebORB via a Python -> Java compiler?

In a word, Jython.

Jython runs in Tomcat as an implementation of the Python programming language. By compiling the Django code, Jython could route between Flex on the front end and the mySQL admin system within the framework of Django.

Incidentally, I'm not going to implement this cookbook recipe just yet. I've worked with WebORB and am sold on it's strengths, but in this instance I'm looking for a lighter and more agnostic solution for the frontend than a uniform rich presentation server.

Namely, I'm going to move forward with Django AMF PyAMF. This allows some of Django's front-end capabilities to shine, and also enables javascript and ajax elements to be plugged into the site design.

More posts to come on this direction.

Out of curiosity, has anyone else tried the setup I outlined above, i.e. Django <-> Java <-> RPC tier <-> RIA? Furthermore, would you go a completely different route or change any of the tiers from the architecture I outlined? It is one of countless possibilities, and on that note, in my experience, one of the most direct and stable available.

No comments: