三层架构和 LINQ to Entities

发布于 2024-07-20 06:08:09 字数 346 浏览 4 评论 0 原文

几年来,我一直使用三层架构(表示层、逻辑层和数据层)来编写应用程序。 通常,我使用 .netTiers 等工具来生成数据层和部分逻辑层。 一切都定义得很好,我喜欢它。

我现在只能使用 LINQ to Entites(看来 LINQ to SQL 已被 Microsoft 放弃),我真的很困惑。 在我看来,LINQ to Entites 生成的代码是逻辑层和数据层的大混合体,我对此几乎无法控制。 此外,我真的不喜欢这样的事实:我必须使用生成的类(实体...)。

最后,您能否分享一下您使用 LINQ to Entities 的经验和最佳实践? 知道我如何仍然拥有一个定义良好的三层架构吗?

谢谢!

For a couple of years, I've been using the three-tier architecture (Presentation, Logic and Data Layer) to write applications. Usually, I am using tools such as .netTiers to generate the data layer and partially the logic layer. Everything is well defined and I love it.

I am now constraint to use LINQ to Entites (it appears that LINQ to SQL was abandoned by Microsoft) and I am really confused. It looks to me like the code generated by LINQ to Entites is a big mix of the logic and data layer on which I have very little control. In addition, I don't really like the fact that I have to use the classes (entities...) generated.

In the end, could you share your experiences and best practices with LINQ to Entities? Any idea how I could still have a well defined Three-Tier architecture?

Thanks!

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

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

发布评论

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

评论(2

誰認得朕 2024-07-27 06:08:09

L2S还没有消亡,但已经基本完成。 它是 Linq 的实现(Sql Adapter)。 Linq 是一种语言功能,并将随着 .net 版本的发布而继续扩展。

Linq 的美丽之处在于简单。 我就是其中之一,除了其他提供商(如 MySql、Firebird 等...)之外,我真的不希望他们把事情搞砸。

L2S is not dead, but it is basically complete. Its an implementation ( Sql Adapter ) for Linq. Linq is a language feature and will continue to expand as .net versions are released.

What makes Linq beautiful is the simplicity. I for one, beyond additional providers ( like MySql, Firebird, etc... ) I don't really want them to muck it up.

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