views:

120

answers:

3

My view is that unless you need to change the basic structure of the user interface, you should not have to reload the page at all for any user interactions.

I'd like to approach my next ASP.NET MVC project with this in mind. Can anyone suggest any principles, patterns or practices* I should consider?

  • Excellent book, btw. Still trying to wrap my head around some of the concepts though. I thought a question like this would help link the theory to a practical design.

edit I should also mention that I intend to use jQuery to handle the asynchronous client/server interactions. Specifically, I'd like suggestions on archetectural considerations to keep in mind

Thanks

+2  A: 

AJAX.

EDIT:

I disagree with the premise, but if you are going to do this, then you need to think through several different issues. I've got a similar app (http://launchpad.uiowa.edu) that has a single main page, but only because it's very simple. There are a fair number of controllers to handle the various possible user interactions so, from an architectural perspective, it doesn't look much different on the back end. One thing that is different is that all of the actions return PartialViews or JSON rather than a full view. That's not particularly an architectural issue but it is something you need to be aware of. You also need to consider how or if you want to handle the case where javascript is turned off.

Another thing you want to figure out is how you want to track usage of the site. Any sort of analytics is going to be pretty much useless. In my case, I've instrumented all of the things that I care about with click handlers that post back to my own tracking code so I can tell how people are using the application.

tvanfosson
@tvanfosson, I was thinking more along archetectural lines. I edited the question to relfect that. Thanks
DaveDev
+2  A: 

Indeed, AJAX, you can do everything on 1 page, it's not really difficult at all once you get the basics.

There are some challenges/downsides though:

  • Search engine optimisation is a non-starter, if you want to rank on google with a single ajax page, you've got a lot of hard work agead.

  • Browser history, broweser history is important to the user experience, so you will need to tackle it, it's not that hard to implement with ajax content though.

Paul Creasey
DaveDev
Using MVC, i don't really think there are any architectural issue if i'm honest, it will just be alot of returning partial views and/or json/xml etc.. instead of the normal view. Otherwise there is little difference, it's part of what i like about mvc
Paul Creasey
A: 

Take a look to ItsNat, is a Java based web framework focused on Single Page Interface applications.

jmarranz