在 ASP.NET 3.5 应用程序中设计数据访问层

发布于 2024-08-05 15:33:11 字数 243 浏览 2 评论 0原文

我需要决定在公司内部网上运行的中型 Web 应用程序的数据访问层。我以前使用过 CodeSmith,发现它很有用,但如果底层数据库架构发生更改,它会消耗大量开发时间,因此我想放弃它并尝试一些新的 DAL,这将有助于快速应用程序开发。

请分享您对 LINQ 技术以及 ADO.Net 实体框架的看法。我从未使用过这些技术,也不知道它们是否可以成功用于以企业数据库为中心的应用程序。

请建议任何其他值得探索的技术。

-斯维塔。

I need to decide about the DATA Access Layer of a medium sized web application to be run on the intranet of a company. I've worked with CodeSmith before and found it useful but it consumes lot of development time if the underlying database schema changes, so would like to do away with it and try my hands with some new DAL which would help in rapid application development.

Please share your opinion about the LINQ technology and also the ADO.Net Entity framework. I've never worked with these technologies and have no idea if they can be sucessfully used for enterprise database centric applications.

Please suggest any other technologies as well which is worth exploring.

-Sweta.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苦笑流年记忆 2024-08-12 15:33:11

我认为你应该使用 Linq (而不是 LinqToSql),因为 Linq 很棒。

我认为您应该使用 ORM,部分是因为您需要类似的东西才能使用 Linq,部分是因为在没有 ORM 的情况下创建数据层并不是花费时间和预算的好方法。

实体框架总体上没有得到很好的评价,但是很多人使用它。它在 Visual Studio 2010 / .NET 4.0 中发生了显着变化。

NHibernate 是大多数人用于 .NET ORM 的方式。有很多选项可供选择。

我认为,这是关于使用存储过程的一个很好的意见:

存储过程很糟糕,是吗?

如果您决定使用 ORM,您可能想看看这个问题以及其他类似的问题:

NHibernate、实体框架、活动记录或 linq2sql

I think you should use Linq (not LinqToSql), because Linq rocks.

I think you should use an ORM, partly because you need something like that to be able to use Linq, and partly because creating a data layer without an ORM is hardly a good way to spend your time and budget.

Entity Framework has not gotten good reviews in general, but many people use it. It is changing significantly in Visual Studio 2010 / .NET 4.0.

NHibernate is what most people use for a .NET ORM. There are a lot of options to choose from.

Here is, I think, a good opinion piece about using stored procedures:

Stored procedures are bad, m'kay?

If you do decide to use an ORM, you probably want to look at this question and the other questions like it:

NHibernate, Entity Framework, active records or linq2sql

巨坚强 2024-08-12 15:33:11

这两个框架都很有用,如果您的数据库基本上是静态的,那么它们会工作得更好。

我的经验是只编写 SQL,但那是因为我一直在开发数据库驱动的应用程序,所以数据库发生了很大的变化。

对于任何 ORM,您都将使用工具捕获源代码中的架构,然后与这些类进行交互,它们会进入数据库。

您可能想了解如何尝试编写视图或存储过程来抽象出实际的数据库表,以便您可以使用更静态的东西。

不过,我确实喜欢 DLINQ,因为我发现执行某些功能(例如分页)比我自己在应用程序中执行更容易。

不过我还没有对 ADO.NET 做过太多工作。

Both frameworks are useful, and if your database is largely static then they work better.

My experience has been to just write the SQL, but that is because I have been working on a database-driven application, so databases change a great deal.

With any ORM you will capture the schema in source code by using a tool and then you interact with these classes, and they go to the database.

You may want to see about trying to write views or stored procedures to abstract out the actual database tables, so that you can have something more static to work with.

I do like DLINQ though, as I have found it easier to do some functionality, such as pagination, than doing it in the application, myself.

I haven't done much with ADO.NET though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文