Developing a Rich Internet Google App Engine Application using Adobe Flex
This entry was posted on 4/26/2009 11:18 PM and is filed under Adobe Integrated Runtime,Flex Builder,cloud computing,AIR,Google App Engine,Adobe Flex,SOA.
Google App Engine (GAE) is a Cloud Computing platform where a developer can build a cloud application and host it on Google servers. GAE at this point of writing supports Python and Java programming models and offers a set of services.The Getting Started documentation of GAE provides several examples to build a GAE application. However these applications are HTML based and do not provide details of building a Adobe Flex based Rich Internet Application client. Hence my intent in this series of posts is to discuss the details of building a GAE application with Flex as the client application providing a number of examples. In this post let us examine the key concepts behind building a Flex based RIA for Google App Engine.
I will discuss the examples using Python as the backend programming language and will assume Windows XP or Vista client machine.
Let us consider a simple problem as below:
1. In the server side logic we will authenticate a user with Google Accounts
2. Depending on success or failure of authentication we will display a suitable message in the Flex application
To implement the solution to this problem, we will:
1. Develop the server code in Python that performs some function using the Services offered by GAE SDK
2. Develop the client code in MXML using Adobe Flex Builder 3.0
3. Test the application using the localhost server, bundled with GAE SDK
4. On successful local testing, deploy the application (both client side and server side) on GAE
5. Test the final deployed application
As a first step, set up the development environment as below:
1. Obtain a GAE application ID by signing up - see http://code.google.com/appengine/
2. Download the GAE SDK for Python
3. Make sure you already have Python 2.5. If not download from http://python.org/ Since GAE supports Python 2.5, it is better to download the same version though higher versions may be available from http://python.org site
4. Make sure you have the Flex Biulder 3.0 installed in your system. If you do not have one, you can download a trial version from Adobe web site. For students Flex Biulder is free.
Before we begin, it is useful to review how Flex connects to a server application.
The earlier generations of Web applications were server centric. The business logic (in this example, "Authentication") executed on server and in addition to this, the presentation content was also generated in the server. You may review the examples provided under Getting Started section of GAE where this point becomes very obvious.
We may note that the sample code in Google Getting Started documentation has a get method that emits the necessary HTTP headers and also the HTML content for the display. This is in line with typical HTML based applications that often have a page based metaphor than an application metaphor.
Since the Flex applications run on the client and are responsible for handling the presentation, they do not require HTML to be generated from the server. Instead, Flex applications just need the data from the server and they can render the data and manage them on the client. Flex applications interact with the server through well defined, standard SOA model. Broadly, three major protocols are supported:
1. SOAP/WSDL based web services
2. REST based services
3. Remote Object protocol that uses Adobe's AMF binary format
In my next post, I will show how to build the client and server applications for Flex/GAE.