X2O lets you build database-driven Adobe® Flex®, Flash® and JavaScript apps
without any server-side development. This is the blog.
Thursday, February 19, 2009
by Mustafa Shabib
Like many developers out there, I've tinkered with my fair share of JavaScript. Initially, like most everyone, I struggled with the DOM and blamed my problems on the terrors of the language. As time passes, however, I've become more and more impressed with the language. Chalk up many peoples' disdain to simple inexperience, unfamiliarity with its dynamic nature, the initial missteps in how the language was represented early on by Netscape, and the general glut of poorly written JavaScript.

I invite you all to check out Douglas Crockford's excellent survey of the language and dig deeper into his site for more valuable information. I share many of my feelings on the language with him and have learned a great deal from him about the language.

The more I've used JavaScript, the more confident I am that it's extremely well suited to developing most web apps. Its loose nature and dynamic abilities allow you to write clearly and concisely, especially when dealing with dynamic data exchange across the web. Its ubiquity and well implemented interpreters across web browsers gives you peace of mind knowing that your code will run as intended in most platforms (I'm talking about the language here, not necessarily how the browser allows you to interact with the DOM). Couple that with the new JavaScript Engine Wars (that are sure to bring great performance boosts), and we are sure to see some great uses of JavaScript in the near future...even more impressive than what's already showing up.

With this and the someday-coming enhancements that Brandon Eich talked about a long time ago, I've developed a client library for JavaScript that piggybacks on X2O, which provides a simple yet powerful data modeling system and an "it-just-works" backend. I've had a great experience putting together a few simple web applications with it.

A Quick Demo
Here is a simple recipe application entirely written in JavaScript, using the X2O framework to handle all the server-side integration. It's an almost-exact replica of our sample with code that we provided for Flex/AS3. Feel free to check out the markup and the JavaScript in the source code.

Some disclosures


  • We aren't obfuscating nor minifying/combining any of our generated script files at the moment. It makes debugging a lot easier right now.

  • Also, there are some pretty serious security implications that we haven't found a solution for yet. Aside from the fact that client-server data exchange happens by generating a dynamic script tag, you can stop the code at any point (e.g. Firebug), modify variables, and do some serious misbehaving. For now, these problems keep the JavaScript implementation from being a viable production-ready option for most applications. We would love to hear of any solutions, ideas, or recommendations any of you JavaScript experts can give us.

  • The actual generated JavaScript may not be the most efficient implementation you could come up with. Again, your thoughts and tips to make it better are very welcome.

We think this latest addition to X2O (which we'll be pushing out as part of the beta release in the near future) helps to elevate the use of JavaScript in your minds as, potentially (some day!), a viable language to use to develop your entire web application.

You don't need to create your own database, build stored procedures, write server-side code, or even integrate your code to data services. All of this is managed by X2O. Like our AS3 version, the mantra is the same: Generate your project, write your markup, your application logic, and upload your scripts, HTML, and resources to your server. Things may just work.

Labels: ,

New to X2O?
Here's how to get started...
Subscribe to our RSS feed


Recent Posts
Previous Months
Also from the makers of X2O