tags:

views:

720

answers:

4

I am currently working on a n-tier (3 tiers) ASP.NET web application with the .NET 3.5 framework.

I would like to know how to load the data in a list control and drop-down list in the fastest way possible utilizing 'best practices' for n-Tier applicaqtions.

What are the best practices using latest and feasible technologies (ASP.NET MVC, Entity Framework, Telerik Combobox for the UI, AJAX, etc.)?

+3  A: 

"The fastest way"? Load your database into local memory and write some optimized assembly code to fetch it.

Seriously though. Your question is very broad, it's like asking "what's the fastest way to build a house". Well... we need a lot more information. What kind of house? What kind of windows? What's the land like?

There are dozens of DAL's, "feasible technologies", and frameworks. Any combination of them is likely to give you what you need. Until you actually set down specific requirements, it's going to be pretty difficult to understand what you're looking for.

womp
+1 .
George Stocker
Ok but is there any best practice (suited to all 3 tier web applications) on this subject ?
jon
No, Jon. It's all dependent upon what you want/need out of your application.
George Stocker
What George said. It sounds like you're looking for someone to say "this is the best technology to use", but in reality, multiple ASP.Net, Java or PHP frameworks are going to meet your needs. As for optimizing them, you'll have to look into each one to see how customizable they are.
womp
For example, SQL Server is a very scalable and performant database, but so is MySQL. You could use either of them with ASP.Net or ASP.Net MVC and create a very fast application. Ultimately the choice of database comes down to price, licensing, and features that you need (for example SQL Server can easily be set up for failover clusters), but either database can be optimized to the hilt for your specific application's read/write performance.
womp
+1  A: 

What womp said. That and the "fastest" way is to not push alot of data to the client but rather minimize what goes down the wire.

Wyatt Barnett
A: 

Build the list & dropdown control on the client with AJAX.

  1. Load data into cached memory on application start
  2. Client makes a JSON request for data to load into the controls
  3. JSON object is created on the server with data taken from the cache and sent back to the client
  4. On the client, iterate over the returned JSON object and and add DOM elements to the list & dropdown control
Alison
What you've described is simply the flow of data between server and client, not necessarily how to do it fast. Admittedly, for cases where you need to update a drop-down list, in response to user interaction with the UI, using such a scheme is generally quicker than doing a full page refresh - and it gives a nice responsive feel to the user.
belugabob
thank you I will test this
jon
A: 

Assuming the choices on the drop-down lists are known at the time the page is rendered, I would use this strategy:

  1. Favor just rendering plain old OPTION tags.
  2. If that slows down the page load too much, use AJAX that is triggered immediately upon page load (set the controls as disabled until populated) so the rest of the form can render.
  3. If that is still too slow, or too unwieldy, use an AJAX auto-complete field.

For (1) or (2) above, if the list of choices is static, I would suggest storing the option list on the server in the Application cache as an HTML string, built by StringBuilder when it has not been created yet or needs to be updated.

richardtallent
actually I want the combobox editable, I guess I'll have to use third party controls then ?
jon
Yes, combobox controls are not part of the HTML standard. I've used ExtJS controls quite successfully, but that's a rather large framework. I recommend, rather than a native-looking combobox, you try an INPUT tag with an autocomplete drop-down function, which can be implemented with Scriptaculous or the JQuery Autocomplete plugin.
richardtallent