开发者

What is the most elegant C# .NET Data Access Layer design?

I would like to konw what is considered the most elegant C# .NET method to produce a Data Access Layer?

I am using MyGeneration DooDads. Is this an elegant solution?

Is it still acceptable to use the CRUD Stored开发者_JAVA百科 Procedures + DAL Library for data access with .NET Entity Framework and NHibernate ORM tools?


You can try to use domain model with ORM (Linq or Nhibernate). Visual Studio has a good support for Linq, it is easy to configure and use. All data access methods are encapsulated in the domain objects (data table objects) and all the query result is strong typed.


There is no answer to this question; everybody has different opinions.

Personally I like ORMs for simple home projects but wouldn't go near one in an application I actually have to support, and much prefer to use stored procedures to give the database a well defined interface that is abstracted from the storage mechanism.

Many people disagree with this point of view. Heck, even I'll probably disagree with it in a few years time. But it doesn't really matter what I think or what they think, if you're happy with what you're doing and find it efficient to code and easy to support, then it's elegant.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜