views:

58

answers:

2

How to develop program/website and minimize DB dependencies using C#.NET? For example I have made some changes in my DB, after that I must rewrite half a project.

+1  A: 

The strategy it to split your application to a different logical layers abstracting the data storage layer from the business logic and UI.

So a simple example will be to have:

  1. Data Layer - your database engine;
  2. Data Access Layer - code which will know how to read and manipulate data from the Data Layer;
  3. Business Layer - will know how to represent Data Access Layer object within your data domain;
  4. Presentation Layer - to display/edit Business Layer objects.

For not very complex domains you can use technologies like LINQ to SQL or ADO.NET Entity Framework to act as 2-3 layers.

Regent
+1  A: 

Read about Repository pattern and nhibernate

jgauffin