Single Platform for Rapid App Development
An end-to-end development and deployment platform for developers, with an out-of-box schema-less database, and a rich set of components for rapid app development
Sandeep Koul
Friday, September 26, 2008
  • Email
  • Print
  • Comments
  • RSS
  • Digg
  • Delicious
  • Reditt

Implementation
To start working with Brainwave, download Brainwave SDK from www.brainwavelive.com. Besides SDK we also installed Python 2.5 for our sample implementation. One also needs Firefox 1.5 or later version. After installing these components, click on 'Start brainwave' and log in using username 'root' and password as 'password'. To create an application, click on 'Application Builder' icon in middle and then on 'Application Generator' icon on left; this will direct you to the page where one can enter the name of the application along with type (sample/crude/basic). We create a basic application by the name 'PCQuest.' Now click on 'Submit.' This will show a tree view of your application. To add code to your application move to the 'pcquest.py' file situated at 'c:\Program Files\Brainwave \apps \pcquest\'. Open this file in a text editor (we used Notepad++) and add the following code:

import iris, aphrodite, hermes
from idea import Idea
class pcquest(iris.App):
def __init__(self):
iris.App.__init__(self)
self.aphrodite = aphrodite.Aphrodite('pcquest')
@iris.expose
def index(self, *args, **kwargs):
return "This is first demo for PCQuest"

Now that we have created an application, let's move to the next step of deploying it. Brainwave comes with inbuilt facility of deploying applications. To deploy applications, click on the 'Application Deployer' icon on left. This will generate a list of applications both loaded and unloaded. Just click on application to be loaded and you are done. To check the output of your application browse to:

http://localhost:8080/pcquest/

In the above code we mixed design and logic. Brainwave platform comes with various template plugins like Cheetah, Mako, etc. These can be used to render data. Following code snippet shows how we can use Cheetah template in our application:

from plugins.CheetahPlugin import CheetahRender
def my_view(self, data):
return CheetahRender(template="my_template.tmpl", data=data, aphrodite=True

In this snippet 'my_template.tmpl' lies at the path 'c:\Program Files\brainwave\apps\pcquest\views'.

Brainwave as a platform is an innovative idea that cuts down issues related to integration and deployment; but it requires knowledge of Python and little bit of brainstorming by developers.

©PCQuest
<<PREVIOUS       



Name
 
Email
Comment Here
 
Code Verification 
   

Skip Navigation Links.
Be first to comment on this article
  
 
 




Copyright © CyberMedia India Online Ltd.
All rights reserved. Usage of content from web site is subject to Terms and Conditions.