既然 Entity Framework 4.0 已经发布,就转储 Linq-To-Sql? [英] Dump Linq-To-Sql now that Entity Framework 4.0 has been released?

查看:20
本文介绍了既然 Entity Framework 4.0 已经发布,就转储 Linq-To-Sql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linq-To-Sql 的相对简单性以及实体框架版本 1 的所有批评(尤其是,不信任投票) 说服我暂时"使用 Linq-To-Sql.现在 EF 4.0 已经发布,我想知道是不是该开始迁移到它了.

问题:

  1. EF 4.0 相对于 Linq-To-Sql 的优缺点是什么?
  2. EF 4.0 终于准备好迎接黄金时段了吗?
  3. 现在是切换的时候了吗?

解决方案

好吧,无休止的争论 :-)

是的,我坚信 EF4 绝对已经为黄金时间做好了准备 - Microsoft 在解决 EF 1.0 版本的几乎所有烦恼和问题方面做得非常出色.

它已准备好迎接黄金时段 - 如果您需要它的所有功能.

Linq-to-SQL 是一个非常简单、简洁、简洁的 OR 映射器——它将一个数据库表映射到一个 CLR 对象——仅此而已.非常基本,非常直接——但是在 SQL Server 之上的一个相当薄的层.

另一方面,EF4 要多得多

  • 对象空间中的概念数据模型
  • 数据库层上的存储数据模型
  • 两者之间的映射层
  • 独立于数据库

因此,如果您确实需要支持多个数据库(而不仅仅是 SQL Server),或者您确实需要能够将数据库结构转变为完全不同的对象模型 - EF4 是一个很好的起点.

如果您有一个简单直接的中小型应用程序,只需要能够轻松快速地将表 1:1 映射到对象,那么我认为 EF4 在简单性和性能方面甚至不相上下到 Linq-to-SQL.

EF4 很棒——如果你需要它的力量——那就去吧!

但是,如果您的要求要少得多,那可能就有点过头了 - 继续使用 Linq-to-SQL(我会)并对此感到满意.我看不出有什么好的理由转储 Linq-to-SQL - 它在 .NET 4 中仍然完全可用,已经获得了一些 错误修复和改进,它至少还会存在几年.

The relative simplicity of Linq-To-Sql as well as all the criticism leveled at version 1 of Entity Framework (especially, the vote of no confidence) convinced me to go with Linq-To-Sql "for the time being". Now that EF 4.0 is out, I wonder if it's time to start migrating over to it.

Questions:

  1. What are the pros and cons of EF 4.0 relative to Linq-To-Sql?
  2. Is EF 4.0 finally ready for prime time?
  3. Is now the time to switch over?

解决方案

Well, an endless debate :-)

Yes, I firmly believe EF4 is definitely ready for prime time - Microsoft has done an outstanding job of addressing just about all the annoyances and issues with the 1.0 release of EF.

It's ready for prime time - if you need all its features.

Linq-to-SQL is a pretty straightforward, no-frills, no-nonsense OR mapper - it maps one database table to one CLR object - and that's about it. Very basic, very direct - but a rather thin layer on top of SQL Server.

EF4 on the other hand is much more

  • a conceptual data model in your object space
  • a storage data model on your database layer
  • a mapping layer between the two
  • database-independent

So if you really need support for multiple databases (and not just SQL Server), or if you really need to be able to morph the database structure into a totally different object model - EF4 is a great place to start.

If you have a simple and straightforward little to medium-size app that only needs to be able to easily and quickly map tables 1:1 to objects, then I don't think EF4 comes even close in terms of simplicity and performance to Linq-to-SQL.

EF4 is great - and if you need its power - go with it!

But if your requirements are a lot less, it might just be overkill - continue to use Linq-to-SQL (I will) and be happy with it. I don't see any good reason to dump Linq-to-SQL - it's still totally available in .NET 4, has been blessed with some bug fixes and improvements even, and it will be around for at least another couple of years.

这篇关于既然 Entity Framework 4.0 已经发布,就转储 Linq-To-Sql?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆