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

DaveDev
  • 41,155
  • 72
  • 223
  • 385

3 Answers3

2

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
  • 524,688
  • 99
  • 697
  • 795
  • @tvanfosson, I was thinking more along archetectural lines. I edited the question to relfect that. Thanks – DaveDev Mar 27 '10 at 15:15
2

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
  • 28,321
  • 10
  • 54
  • 90
  • @Paul, I was thinking more along archetectural lines but thanks for pointing out the SEO & Browser experience issues. I guess I'd also have to account for user interactions with the browser, such as the back button and dealing with state when they *do* refresh the page – DaveDev Mar 27 '10 at 15:19
  • 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 Mar 27 '10 at 15:25
0

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

jmarranz
  • 6,459
  • 2
  • 21
  • 10