views:

71

answers:

2

I've recently found an interesting alternative to the ASP.NET MVC that I currently do: static HTMLs with advanced JavaScript doing service calls (most examples use OpenRasta). For example see this or this.

Personally I always had a feeling that web apps need to move towards JavaScript frameworks. To me it feels the code in MVC to wire up client/server side validation (and other things like translating business models into view models) seems awkward and a bit unnatural. Actions that basically takes data and return JSON, or actions that just do "return View()" is a clear indication of that.

However, the question is not what's better - this is kind of discussion that I don't think SO likes ;-) My question is: have you tried both? Would you suggest to invent into learning jMVC and alike? Any good articles on the subject? Pros and cons? For example, big cons in my opinion is a very strong SOC, a ready-to-reuse service, etc.

To sum it up: what direction would you suggest to move further?

+1  A: 

A couple of points:

  • Only client side validation means no validation

  • JavaScript-pulled content is not visible to search engines

Developer Art
Yes, and I'm sure jMVC developers are aware of that... I'm looking for good information on what are the problem with the approach, are the problems solved, etc. E.g., how do they avoid duplication of server-side validation, etc. As for search engines (and other mantras many believe in), that often doesn't matter for intranet and corporate sites.
queen3
A: 

Folks want rich functionality in the client, lots of pretty strong reasons for that. There is also a drive towards low maintenance overhead client installs, hence Browser-based clients are very popular.

Now, there's various approaches (eg. Flex) that are alternatives to JavaScript as the primary implementation mechanism, but I am seeing an awful lot of interest in JQuery and Dojo. So I think it's quite reasonable to head down the Javascript route.

Clearly, you can just stick with more or less a standard web model and just make each page "prettier" nicer widgets, a bit of client-side validation etc. But as you've observed the real power comes when the javascript is itself pretty rich, and just makes service calls for data and to perform actions. We then get to the question of how best to architect apps with a rich client tier, and I think that's the nub of your question.

My view: we end up with a true Model/View/Controller pattern in JavaScript in the browser, but the model in the browser has an interesting relationship with another layer in the server, and that layer may well do server-side processing for the BrowserModel. So there may well be an MVC-composition on the server too. I think that the art is still evolving in this area. Frameworks are coming along but clear winners such as Struts in the old Web 1.0 Java world have yet to emerge

djna