Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
RoR and client-side MVC
4 Posts
RoR and client-side MVC

Hi. RoR does a great job with MVC pattern in the server-side, plus it´s integrated with great javascript libraries: scriptaculous and prototype, but these libraries are not mvc frwrks. (not that this is a problem)

It´s yet a relatively new topic, but I think client-side mvc frwrks are catching up. To name a few:

  1. JavascriptMVC: http://javascriptmvc.com/
  2. SproutCore: http://www.sproutcore.com/
  3. TrimPath Junction: http://code.google.com/p/trimpath/wiki/TrimJunction
  4. Axiom Stack: http://www.axiomstack.com/
  5. Archetype : http://archetypejs.org/

And now comes the doubts:

  1. Is it really a good idea to use mvc pattern in the client-side?
  2. If so, mixing directory structure from some client-side frwrk with RoR will be very confusing
  3. Maybe the best thing is wait until RoR integrate some of this frwrks?

I´d like to hear some personal opinions in this suject.

I would be concerned about the flexibility of coupling between the server side and client side. In other words is the choices in he client side MVC messing up the server side MVC and vetc.

I'd separate the notion of a framework being "MVC" and of it being "client-side" (or "Thick Client").

MVC in itself is great. It promotes DRY, and can drastically simplify and consolidate your code. No need to wait for that.

"Thick Client" solutions tend to move a lot of the application logic to the client, turning the server into more of a lightly abstracted database. This is good if you are wanting to make a responsive app that can easily go off-line. It's also good if you are looking at reducing hosting costs - after all your server won't be doing a lot 90% of the time.

However it does have its down-sides - you have to worry about syncing, slow clients, and of course people can more easily steal your code.

Personally i think these "Thick Client" solutions are great in theory, but they are not going to be ideal for every type of application. So i'd wait until i was going to implement something that really needed off-line or very responsive functionality before i would actually use them for real.

I actually find it very hard to identify the MVC pattern applied in client-side, but independent of having a thick or thin client-side, imho it would be very interesting of having a standard way (some pattern) to follow when coding the client-side part. This would be of a great benefit for us all. And this pattern wouldn´t have to be specific for javascript, but for all the client-side things like html, css, etc as well

4 Posts
Login to add your message