Review: Yahoo Mojito gives server-side JavaScript a lift

Yahoo's open source framework combines YUI on the client, Node.js on the server, and excellent use of MVC design pattern

1 2 3 Page 3
Page 3 of 3

There are still some limitations. I wish Mojito had some coupling with databases because that's what many developers are going to want to do. Node frameworks such as RailwayJS and Locomotive offer Rails-like connections to traditional databases. If you want a quick CRUD scaffolding to create, update, or delete rows in the database, one command can build them for you.

Web apps without SQL

The Mojito documentation on data access talks about cookies and Yahoo Query Language, not SQL or NoSQL. The counter-SQL argument is that the data should live in its own realm in a JSON-compatible server that takes RESTful queries. The Rails-like integration is too much, and it shackles the developer. Leaving the database connection out of Mojito frees it.

The Yahoo team should forge a tighter alliance with the major NoSQL databases that speak JSON and JavaScript already. MongoDB, for instance, which takes queries in the form of JavaScript functions, is a natural partner. A difficult question is whether there also needs to be better integration with MySQL and other traditional databases. These continue to have strong followings, and if Mojito wants to gain access to shops with legacy SQL databases, the project will have to consider tighter integration. Or maybe they'll just insist that the legacy stores start answering RESTful queries with proper JSON.

Will Mojito succeed? The speed of Node will continue to attract new experimenters who quickly discover they can't build an entire Web application in one file as many of the hard-core Node lovers do in their early demos. As soon as they discover that raw Node programming can produce inscrutable code that's nested in endless layers of curly brackets, they will be running to frameworks like Mojito. Mojito's structure and JSON configuration files unpack much of this complexity and spread it out over a number of directories and files. Some JavaScript programmers may be a bit put off by all of this atomization, but the structure has served the MVC community well over the years.

The flexibility of using pure JavaScript on both the server and client should also be very attractive. Several other projects, including Google Dart and Opa, are trying to create new languages that offer the same code base for client and server, but these approaches require learning yet another language. Mojito runs regular JavaScript, which will be handy when you encounter the weird, edge conditions of the language and need to program around them. There will be differences among browsers for the immediate future, and adding another language doesn't always smooth them over. Despite the improvements offered by the newer languages, most developers will prefer to write native JavaScript.

I think Mojito can have a long and happy life with Web developers who yearn for the structure provided by popular MVC frameworks but are tired of writing different languages. My guess is we'll go through several more rounds of cross-pollination among the various projects fighting for attention. Yahoo did a nice job of extending YUI to handle much of the work on the server. When deeper connections to the various data stores appear, we'll finally have a strong enough structure to build serious applications using only JavaScript.

This article, "Review: Yahoo Mojito gives server-side JavaScript a lift," was originally published at Follow the latest news in software development, JavaScript, and HTML at For the latest business technology news, follow on Twitter.

Copyright © 2012 IDG Communications, Inc.

1 2 3 Page 3
Page 3 of 3
How to choose a low-code development platform