views:

313

answers:

2

I often hear about Flex being combined with web frameworks on the backend. The idea being that Flex serves as the presentation framework while the web framework (Django/Rails) does the database lookups and sends the data to Flex to present in the form of XML.

However, is there ever a situation where Flex and Python/Ruby would be combined without a web framework as an intermediary? Under what circumstances might such a combination make sense (if any)?

(I'm trying to think of projects where the functionality of a scripting language would be complementary with the functionality of Flex - but also whether it's possible for the two to be combined without too much high jinx).

+4  A: 

You can still code against WSGI directly in Python. If that's the route you want to go, PEP 333 is about the only way to go.

With that said, doing so is a good learning experience, but WSGI wasn't really intended to be used directly. You don't have to use a full-stack framework like Django if you don't want to. If you want something more light-weight, might I suggest CherryPy or web.py? They're a lot more light-weight than Django is.

There are other options aside from WSGI, but they'll pretty much all have about the same caveats. In other words, it can be done, but usually isn't recommended.

Jason Baker
+1: roll your own is hard.
S.Lott
+1  A: 

Flash player allows developers to open sockets to remote applications. It is feasible that you could create a Flex application that connected to a remote server and transferred binary or serialized data. This has the added benefit of supporting asynchronous communication, so such a thing might be practical for multiplayer games or chat clients.

Adobe develops an application for this purpose called Flash Media Server (Unless the name has changed).

There is also an open source project called Red5 with a similar feature set.

Finally, there are several libraries that enable serialization and transfer of flash objects between languages. Some examples are AMFPHP http://www.amfphp.org/, and the much more advanced Flex Data Services http://www.onflex.org/ted/2006/05/flex-data-services-part-1.php.

Gdeglin