CowherPower
CowherPower

Reputation: 315

Need advice on selecting a data access method

I am in the early stages of planning a conversion of a large classic ASP database application to ASP.Net and I'm having trouble picking out which data access method to use. I have played around with Linq To SQL, Dynamic Data, strongly typed datasets, Enterprise Library (Data Access Application Blocks), and a tiny bit with Entity Framework, but none of them have jumped out to me as "the one". There are just too many choices - my head is swimming, help me choose!

Perhaps it would help to give some background on the application that I am converting along with the priorities...

Thanks for any advice that you can offer!

Upvotes: 6

Views: 501

Answers (3)

James Black
James Black

Reputation: 41858

You may want to look at decoupling the database layer from the asp layer so that you can not only give more flexbility in making the decision, but when you have to make changes to a customer's database you can just swap in a new dll without changing anything else.

By using dependency injection you can use xml to tell the framework which concrete class to use for an interface.

The advantage to doing this is that you can then go with one database approach, and if you later decide to change to another, then you can just change the dll and go on 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 making your own connections? Then you can move the rest of your code and along the way you can decide which of the myriad of technologies to use.

For a new application I am working on I am starting with LINQ to SQL for it, mainly because development will be quicker, but, later, if I decide that won't meet my needs I will just swap it out.

Upvotes: 2

Gary.Ray
Gary.Ray

Reputation: 6501

Look at all three articles in this series:

High Performance Data Access Layer Architecture Part 1

Great advice.

Upvotes: 5

JoshBerke
JoshBerke

Reputation: 67078

nHibernate might be a good fit. You can store the mapping in external configuration files which would solve your needs. Another option might be using ActiveRecord, which is based upon nHibernate.

nHibernate has a neat feature which you might find helpful. It's called a Dynamic property which is basically a name value pair collection populated by pulling the column names from the mapping file. So when you add a column at your client site, you update the mapping file and you'd be able to access the data through a collection on the object.

Upvotes: 1

Related Questions