几年来,我一直使用三层架构(表示层、逻辑层和数据层)来编写应用程序。 通常,我使用 .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!
发布评论
评论(2)
Ian Cooper 撰写了有关使用 Linq2Sql 构建应用程序的精彩系列:
希望您找到您需要的内容。
Ian Cooper wrote good series about architecting application using Linq2Sql:
Hope you find what you need.
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.