views:

258

answers:

2

When building big GUI based applications in other languages like C# or Java, we have various patterns like MVP, MVC, MVVM, and even complete guidance packages like Prism (WPF/Silerlight) that help us keep our code maintainable, extendable and keep the complexity of the application at a sane level.

But when it comes to big RIA applications written with html/javascript, I find it hard to find any really good resources.

What are the do's and don'ts for creating a big RIA application in html/javascript (for creating applications like Gmail, Google Calender, Google Docs)?

+1  A: 

Patterns are fairly language agnostic. There's nothing specific to javascript/html that I know of. Well, aside from the module pattern, but that's not really an application design thing, it's more about style.

Since you're from the big fat C# Java CLASS based, rigid, static, object oriented world, I would suggest having a look at functional programming languages like lisp and haskell, to have a look at the design patterns of those, if you're looking for something fresh and interesting. Javascript can accomodate functional language patterns, or object oriented patterns.

Have a read through javascript.crockford.com to give you some idea of what kinds of things are possible in javascript, and what style patterns make sense.

application design is basically the same in every language though.

Breton
+1  A: 

Development of Rich Internet Applications is still a very young topic and there are many different approaches, with more and more popping up every day. Additionally JavaScript is quite a different language to what Enterprise Developers are used to.

What you imho should NOT do is trying to avoid developing in JavaScript directly. Of course there are many Frameworks that seem to help you to get around the JS part (GWT and the .NET Framework AJAX stuff are doing a fairly good job), but you will never be able to use the full potential of the language itself and your Rich Internet Application will be forever bound to your server sided programming language / framework and its abilities, which is not necessary at all and in my opinion a bad design as well. I would separate the server sided programming as much as possible from the client programming. Unlike old school web applications you can request and process any data asynchronously so there no need for your webserver to generate (with generate I mean HTML generation with the server side language) any HTML at all. With the separation between data on the server side and representation on the client side you will loose lots of the complexity RIA development might bring with other approaches (like trying to press it in one of the old fashioned server side MVC frameworks).

On the client side you'd it depends on your likes what you choose. There are lots of different Frameworks following different ideas. You can have the ones focussed on DOM manipulation , Component based ones with focus on GUI elements or one following the MVC pattern on the Client side ... and so on.

Daff
Thanks for the input. I have been looking at the javascriptmvc framework you link to. There is also an interesting project in development by the guys from Aptana called ActiveJS (http://activerecordjs.org/) which looks very promising.
Egil Hansen
Hm, I like the Aptana products, but ActiveJS seems very Jaxer oriented though (so even if there is JavaScript on both sides you can't reach the loose coupling of client and server). But I surely will have a look at it
Daff