Need advice on choosing a data access method

I am in the early stages of planning the conversion of a large classic ASP database application to ASP.Net, and I am having trouble deciding which data access method to use. I played with Linq To SQL, dynamic data, strongly typed datasets, the corporate library (Application Access Blocks), and a small bit with the Entity Framework, but none of them popped up to me like "that one." There are too many options - my head is floating, help me choose!

Perhaps this will help to give some idea of ​​the application that I am converting along with the priorities ...

  • The back end is Microsoft SQL Server (2005 or later), and we are committed to this, so I don’t have to worry about supporting a different database platform.

  • The database is very mature and contains most of the business logic. It is highly standardized and makes extensive use of stored procedures, triggers, and views. I would prefer not to invent two wheels at the same time, so I would like to make as few changes to the database as possible. So I need to choose a data access method that is flexible enough to allow me to get around any quirks in the database.

  • The application has many forms of data entry and advanced search and reporting capabilities (reports are another beast that I will solve later).

  • The application must be flexible enough to cope with minor changes in the structure of the database. The application (and the database) can be installed on different sites where minor changes have been made to the database. Ideally, an application can identify database extensions and respond accordingly. In other words, if I need to keep the O / R mapping in the application, I should be able to exchange it (or easily update) when installing the application and database on a new site.

  • Rapid application development is critical. Since the database has already been completed and the user interface will closely match the existing application, I hope to find something where we can handle it pretty quickly. I’m ready to sacrifice without using the absolute latest and greatest technology, if this saves development time. In other words, if there is a steep learning curve using something like the Entity Framework, I am fine with switching to something like a strongly typed dataset and a custom DAL if this speeds up the process.

  • I am new to ASP.Net but am familiar with classic ASP, T-SQL, and old ADO (e.g. disabled record sets). If any of the data access methods is better for someone from my background, I can lean in that direction.

Thanks for any advice you can offer!

+6
linq-to-sql entity-framework dynamic-data data-access-layer
source share
3 answers

Take a look at all three articles in this series:

High Performance Data Access Layer Architecture Part 1

Great tip.

+5
source share

You may want to decouple the database layer from the asp level so that you can not only give more flexibility when deciding, but when you need to make changes to the client database, you can simply change the location in the new dll without changing anything else.

Using dependency injection, you can use xml to tell the structure which particular class to use for the interface.

The advantage of this is that you can go with one approach to the database, and if you later decide to switch to another, you can simply change the dll and continue without making any changes to other layers.

Since you are more familiar with it, why not just go directly to the database at the moment by creating your own connections? Then you can move the rest of your code and along the way you can decide which of the many technologies to use.

For the new application, I am working on the fact that I start with LINQ to SQL for it, mainly because development will be faster, but later, if I decide that it does not satisfy my needs, I will just change it.

+2
source share

nHibernate may be appropriate. You can save the mapping in external configuration files to help you solve your problems. Another option would be to use ActiveRecord based on nHibernate.

nHibernate has a neat feature that may prove useful. It is called a dynamic property, which is basically a collection of folders with a name that is populated by pulling the column names from the mapping file. Therefore, when you add a column to your client site, you update the mapping file and you can access the data through the collection of the object.

+1
source share

All Articles