Suggestions for Single-Page Web Application Design?
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 t开发者_运维问答o 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
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.
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.
Take a look to ItsNat, is a Java based web framework focused on Single Page Interface applications, only only problem for you ... is Java
精彩评论