Advertisment

Single Platform for Rapid App Development

author-image
PCQ Bureau
New Update

Brainwave is a Web-based rapid application development platform for

developers, which aims at solving developer issues surrounding integration. Most

of the platforms available have three-tier architecture constituting components

for building interface of the application, for developing actual logic of the

application, and for databases. Normally one goes for different vendors to carry

out work in these three different domains and finally integrates these

components to get a final product. Owing to different vendors, integration

becomes a complex task; Brainwave tries to simplify this complexity by

introducing a single platform that can take care of all the components required

in building applications. Brainwave SDK comes with a special database engine,

API widgets library and deployment server.

Advertisment

Components



Brainwave platform has six components for rapid application development. Let's
take a look at these components.

Direct Hit!
Applies To:

Application developers



USP: Single solution for complete application
development



Keyword: Brainwave SDK


Primary Link: www.brainwavelive.com

We'll start with the component that makes Brainwave different from others.

Poseidon, the database engine of Brainwave platform, is a schema-less neural

database built to overcome certain issues related to a conventional relational

database like normalization, relationship between primary and foreign keys, etc.

Poseidon stores data with the help of 'Meme' and 'Link,' where Meme is used to

store data and Link represents relationship of data. Meme the fundamental unit

of data in Poseidon has a 128-bit global unique identification key, name, and

associated aliases.



The next important component of Brainwave is the application server that is code
named 'Iris'. Iris is a Python-based server built on Open Source CherryPy

project (www.cherrypy.org).



Templating system of Brainwave is named 'Aphrodite,' which is an XSLT
(Extensible style sheet language transformation used to display XML documents on

browser) based tinplating system that contains many predefined templates that

can be used by developers. For security Brainwave comes with Cerberus, the

security manager. Security is based on capability and policies where capability

is unforgettable and communicable token of authority and policies are used to

give permissions (read/write/link) to users. Besides these four components, the

rest two components in Brainwave architecture include Hermes, a protocol that

provides Web services to applications not built on Brainwave platform and Gaea,

kernel that provides mechanism to plug-and-play from different vendors.

Advertisment

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"






Advertisment

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/

Advertisment

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.

Advertisment