New Contribution: LIBERATED

Derrell Lipman, a long-term qooxdoo contributor and active supporter of the framework, has been working on a very exciting project for the past year or so, and has already based a complete application on it. We happily share the following information with the community. Great achievement, Derrell, thanks for contributing!

In traditional client-server development…

Traditional web-based client-server application development has been accomplished in two separate pieces: the frontend portion which runs on the client machine has been written in HTML and JavaScript; and the backend portion which runs on the server machine has been written in PHP, ASP.net, or some other “server-side” language which typically interfaces to a database. The skill sets required for these two pieces are different, meaning that sometimes the frontend and backend are developed and tested completely independently, based purely on an interface specification. More recently, server-side JavaScript has begun to gain momentum, allowing for more overlap of skill set, but still requiring separate development and testing of the frontend and backend pieces.

Be LIBERATED from those hassles!

LIBERATED is a new methodology for web-based client-server application development, in which a simulated server is built into the browser environment to run the backend code. This allows the frontend code to issue requests to the backend in either a synchronous or asynchronous fashion, step, using a debugger, directly from frontend code into backend code, and to completely test both the frontend and backend portions. That exact same backend code, now fully tested in the simulated environment, is then moved, unaltered, to a real server. Since the application-specific code has been fully tested in the simulated environment and moves unchanged to the server, it is unlikely that bugs will be encountered at the server that did not exist in the simulated environment.

Be LIBERATED!

LIBERATED is a fully in-browser client and server web application debug and test environment, and qooxdoo-based backend environment. It allows (but does not require) you to write all of your code, both client- and server-side, in JavaScript, using qooxdoo coding style. It has a database abstraction layer, with existing database drivers for App Engine’s object datastore and SQLite’s SQL-accessed relational database. Additional database drivers can easily be written. There is also a built-in JSON-RPC Version 2.0 server. Additional handlers, such as REST, could be implemented for use instead of or in addition to JSON-RPC.

The real benefit of LIBERATED is that it allows the entire application, both frontend and backend, to be debugged and tested fully within the browser environment, running the backend code in the LIBERATED server simulator. This means you can set breakpoints with Firebug in your backend code, step through to find bugs, etc. Once all of your code is fully debugged and tested in the simulated environment, you simply move the backend code, generally with no changes, to the real server.

Architecture

The figure above shows the architecture of the development and production environment when developing with LIBERATED. The frontend code runs on the client machine (i.e., in the browser). Backend code runs on a server machine and/or on the client machine, with the exact same application code (“business logic”) and application communication protocol, e.g., JSON-RPC, REST, etc., code in both environments. The actual database differs in the two cases, but the application’s interface to the database is identical regardless of which backend is in use. Similarly, the application communication protocol code is the same regardless of backend, but the messages arrive from web servers unique to the backend, for parsing.

Further details

LIBERATED is simply a “library”, in qooxdoo parlance. It is installed like any qooxdoo contrib or other library by referencing its Manifest.json file in the application’s config.js “libraries” section. LIBERATED currently runs in App Engine or with the Jetty web server.

As to using it, LIBERATED is described in excruciating detail in Derrell’s thesis. Although that document uses the current name of the library (LIBERATED), it predates the renaming of the namespace, so anyplace you see rpcjs in the document is now called liberated.

The API documentation should be quite complete, so running ./generate.py api from the top level will provide the normal API viewer with a fair amount of useful information. In particular, for database manipulation, see liberated.dbif.Entity. Some additional and better user-level documentation would definitely be useful, and might be added over time. Derrell invites you to get familiar with LIBERATED and appreciates your feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">