您现在会为数据层选择什么:Linq 还是 Subsonic?
我们已准备好在工作中启动一个全新的项目,没有遗留代码。 我们过去确实使用过 Subsonic,我们对此非常满意。 但那是在 Linq 之前。
有人必须面对同样的问题吗(Linq x Subsonic)?
你的决定是什么? 原因是什么?
任何见解表示赞赏。
We are ready to start a brand new project at work, no legacy code. We did use Subsonic in the past and we pretty happy with it. But that was before Linq.
Has anyone had to face this same issue (Linq x Subsonic)?
What was your decision? What were the reasons?
Any insight appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
SubSonic
优点:
缺点:
请记住:
Linq To SQL
优点:
缺点:
请记住:
另请评估 ADO.NET 实体框架 和此处。
SubSonic
Pros:
Cons:
Keep in mind:
Linq To SQL
Pros:
Cons:
Keep in mind:
Also evaluate the ADO.NET Entity Framework and here.
我喜欢 LINQ 的一件事是自动处理连接,我认为 SubSonic 处理得不够优雅。
会自动生成这样的SQLL
The one thing I love about LINQ, which I don't think SubSonic handles as gracefully, is automatically dealing with joins.
will automatically generate SQL like thisL
NHibernate 怎么样? 对于新项目来说真的不可行吗? 不过,来自 Java 的人会发现它很熟悉,您也可以将它与 .NET 2.0 和 Mono 一起使用。
What about NHibernate? Is it really out of the picture for new projects? Still, people coming from Java will find it familiar and you can also use it with .NET 2.0 and Mono.
我选择了 Linq,因为它内置于框架中。 对于那些说 Microsoft 不会支持它的人来说……LinqToSql 将被逐步淘汰。 我相信计划之一是将其吸收到实体框架中。
我现在正在使用实体框架。 它还使用 linq,基本上它与 linqToSql 完全相同,如果您选择使用它,它会具有更大的灵活性和功能。
我倾向于避免使用第三方框架和规范,因为它们最终也会消失。 我相信它们消亡的机会更大,因为它们的生命来自于有多少人对它感兴趣并使用它。 他们的生活也严重依赖于其主要作者/贡献者。
I went with Linq because it's built into the framework. For those saying it will not be supported by Microsoft... it's LinqToSql that is going to be phased out. I believe one of the plans is to absorbe it into the Entity Framework.
I'm now using the Entity Framework. It also uses linq and basically it's exactly like linqToSql with more flexibility and power if you choose to use it.
I tend to avoid 3rd party frameworks and orms because eventually they die out as well. I believe they have more of a chance to die out because their life comes from how many people are interested in it and use it. Their life is also heavily dependent on it's main author/contributor.
我的经验主要是使用 SubSonic。 部署非常简单,您将在半小时内完成 DAL。 请记住,这是一把瑞士军刀,因为它是为实用而设计的。 基本上,您会获得每个表生成的类,以及对集合执行延迟加载的能力。 您还可以通过框架执行存储过程,因此如果您有复杂的数据结构,您可以从数据库中获取它们并更新您手工制作的类。
我现在已经在 5 个主要项目中使用了它,我对它的依赖程度印象深刻。
My experience has been primary with SubSonic. It is very straight forward to deploy and you'll have your DAL completed in under a half hour. Bear in mind that this is a Swiss Army knife, as it is designed for utility. Basically you get a class generated per table, as well as the ability to peform lazy loading for collections. You can also execute stored procedures via the framework, so if you have complex data structures you can fetch them from the database and update a class that you hand craft.
I've used it on 5 major projects now, and am impressed with how quickly I became dependent on it.
我也有同样的情况。 LinQ 更加“视觉化”,你可以在 vstudio 中完成所有操作,甚至 Rob 也承认 subsonic 有一些与之匹配的东西。
IEnumerable、LINQDatasource(带自动分页)和可视化建模说服我选择 Linq 而不是 Subsonic。
I was in the same situation. LinQ is more "Visual", you do everything inside vstudio, and even Rob admits subsonic have a few things to match it.
IEnumerable, LINQDatasource ( with auto paging) and the visual modeling have convinced me to choose Linq over Subsonic.
linq to sql 的最大风险是 Microsoft 会厌倦它并放弃它。 有很多猜测认为这已经发生,并且只会更新实体框架。 Subsonic 不会受到这种情况的影响,更糟糕的情况是你有源代码来进行编辑。
The biggest risk with linq to sql is that Microsoft will grow tired of it and abandon it. There is a lot of speculation that this has already happened and that only the entity framework will be updated. Subsonic does not suffer from this and worse case you have the source code to make your edits.
您可能想了解一下 MS 停止开发 LINQ to SQL,正如它似乎正在发生的那样。 SubSonics 的最新版本比以前的版本更容易创建查询并且更具可读性。
You might want to look into what happens when MS stops developing LINQ to SQL,as it appears to be happening. SubSonics latest version is easier to create queries and more readable, then their previous version.