Ben Godfrey

Client-side MVC is maturing

Rich Internet Applications (RIAs) are still increasing in popularity. We’ve reached the stage where they aren’t called RIAs any more, they’re just cool websites. (Ever heard someone call Facebook an RIA?) There is a increasing demand for tools to build great UIs easily and to build JavaScript-only applications for platforms such as OpenSocial. There are a range of toolkits for building RIAs but most of them are tied to a specific server platform.

A framework takes care of repetitive tasks. In an RIA, these include building screens, including providing rich controls, validation etc. The framework should also provide an abstraction for maintaining state and requesting data from web services via XHR. While building an OpenSocial application in December, I could have saved a lot of time developing on top of such a framework.

MVC is the dominant model for UI development in the desktop world. A modified form is very popular in web development. It makes a lot of sense to stick to MVC for RIA development. RIAs running in the browser (or Flash or AIR) bear close resemblance to desktop applications.

Of the server-and-client toolkits, Google Web Toolkit is perhaps the best known. You write Java code and it compiles it to a web application complete with HTML, JavaScript and CSS. This is an interesting idea, but the server-side component is not interchangeable and requires Java. It also leaves virtually no visibility in the compiled code.

Wouldn’t it be great if there were a client-side only JavaScript framework which allowed you to build nice UIs quickly and easily and load data from any server back-end? Given the variety of technologies for server-side web app code, you think this would be an active area. Doesn’t it slightly suck that you have an interesting web toolkit in GWT and a cool cloud hosting platform in App Engine, both from the same company, but you can’t use them together?

I was pleased to see that the cunningly-named JavaScriptMVC framework got it’s version 1.5 release. This version adds some new development tools and documentation, but it’s still back-end independent. On the other hand it does look a little heavyweight.

Topper Bowers just open-sourced his Mamoo framework. Although Mamoo doesn’t seem to be a run-of-the-mill RIA platform, it does provide some of the MVC goodness that those applications need.

I look forward to checking out both of these projects in more depth. Certainly JavaScript-only MVC frameworks are needed if smaller development operations are to produce applications with the level of quality and UI finesse seen in, for example, Facebook or GMail.

Bookmark and Share

Comments

David Gildeh http://www.davidgildeh.com/

Hi Ben! I hear you’re coming back from your travels soon! Hopefully catch you around soon

As for your blog, I do disagree with some points. Javascript is really bad to debug, hand written javascript is usually clunky and I don’t believe JavaScript will ever become a dominant application framework for RIAs by itself. I use GWT, it’s fantastic and addresses all the limitations of Js and gets better all the time with new libraries and features. I never plan to write another line of Js in my life again (unless it’s a GWT native method ;)) and if you google you’ll find some ports and tutorials on how to hook GWT into other environments such as PHP and RoR. You can use Rest to abstract it completely from server if needed!

By the way, look into ExtJs if you want to use a very sexy and powerful MVC Js only framework. Also has a port for GWT ;)

Cancel

Ben Godfrey http://aftnn.org

I personally like JavaScript a lot. I certainly prefer it to verbose, clunky Java.

Debugging is not perfect, but has got a lot better now that Firebug is around.

See also: The Law of Leaky Abstractions with regard to RJS, GWT, etc.

Cancel

Topper Bowers http://blog.toppingdesign.com/

Glad you liked Mamoo. It’s being used pretty heavily in production now, but it’s early days for “community.” Please feel free to email me if you have any questions.

Also, javascript is a nice language when you get used to it. Modern development is becoming much easier in it and projects like JSUnit or ScrewUnit (my personal favorite) make testing much easier.

Cancel

Add a new comment

Your avatar

Add a new comment

Cancel   Forgot password?
Cancel

Attention! Log in (if you've commented before) or use your OpenID.

You can use Markdown here.

Preview