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

By Peter Wayner, InfoWorld |  Development

The Mojito framework is also a good way for Yahoo to extend the reach of its APIs. It only takes a few lines of code to issue a call written in the Yahoo Query Language (YQL), the lingua franca for accessing Web databases like Flickr. The other parts of the Yahoo empire, including Yahoo Maps and Yahoo News, take the same style query. If you rely on any of these APIs, you'll be even more interested in Mojito.

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 SQLThe 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.


Originally published on InfoWorld |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness