开发者

What are some tips for a high traffic, complex form in ASP.NET MVC?

开发者 https://www.devze.com 2023-01-18 09:46 出处:网络
We currently have a WinForms application that we want to slowly migrate to a web application. One screen is a time sheet entry system that uses DataWindow and is very slow and buggy.

We currently have a WinForms application that we want to slowly migrate to a web application.

One screen is a time sheet entry system that uses DataWindow and is very slow and buggy. Anyway, the time sheet screen has five sections that are saved in real time. A finished time sheet needs 2-5 of these sections.

Currently, the system runs SLOW. Some of our remote offices barely have a frac-T1.

So I want to redesign that screen using ASP.NET MVC2 and even provide some enhancements like autocomplete (which it currently lacks), etc.

Any suggestions on best practices for a form that I KNOW will be high-volume AND run on possible slow networks?

Currently, there is a lot of round-trip traffic because each section of the time sheet saves w开发者_JAVA技巧hen they tab out of a field. I would like to avoid this but I do admit the partial saves are cool.

Any suggestions or tips are appreciated.

Thanks


This is a tough one to give a definitive answer for - whichever option you take there will be trade-offs and compromises.

Personally I would suggest OOB Silverlight 4 + WCF.

You get the one-off hit of downloading the Silverlight app1, but once they have that installed the only traffic you should have is the data and messages sent to/from the web services. Cutting traffic down to just pure data+messages and eliminating the HTML will reduce congestion a lot.

You could use AJAX from ASP.Net or ASP.NET MVC, but you still have the hit of downloading the page each time the user wants to fill out a time sheet. AJAX can also be a little chatty, especially when it comes to providing functionality like autocomplete. It can also be considerably more difficult to get a nice to use UI when using ASP.NET/MVC, with SL you will find it easier to emulate the UI functionality of the current Winforms app. And in my experience development of rich web apps is considerably faster in Silverlight than ASP.NET.

In any case, it may be best if you code up some demos using both technologies, and run them to see exactly how they perform in the worst offices, that will be the only way to know for sure which is best.

1 The traffic hit of downloading the Silverlight app can be reduced by using SL4, make the app an Out of Browser one, shipping out the XAP file to the users and using sllauncher.exe to install it (this is bread and butter stuff for sysadmins). This does make it harder to update the SL app, but you could just do it this way in the offices where network traffic is particularly bad.


php/lamp vs. asp.net mvc: the only factor involved isn't licensing cost. The team plays an important factor, of course this depends on your pre-existing skills, but there will be a higher overhead of development + infrastructure by chasing the platform you are less used to.

The project might not give the expected results because of that, and that'd be a bigger problem than saving a small %. Pre-emptive strike: you don't need to use ms sql with asp.net MVC, so "the database license doesn't make it a small %" isn't a valid argument.

As for hints check the answer I posted to this question: Scalable application with ASP.NET or Google AppEngine. Additionally:

  • you don't need to load all those tabs at once. You can retrieve the tabs as the user selects them. This will make the initial load time faster (at the cost of a hopefully v. small delay when opening other tab for the first time). If appropriate for the scenario, you can hold the already opened tabs at the client, so the extra hit/delay only occurs the first time the extra tab was opened.

Currently, there is a lot of round-trip traffic because each section of the time sheet saves when they tab out of a field. I would like to avoid this but I do admit the partial saves are cool.

You might already be doing so, but you can use change detection to make sure its only posted when the user actually made a change. Additionally you don't need to send the whole tab, you could send just the changes to be made.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号