开发者

Confused on which one to to use - Linq to SQL, Datasets or Ado.Net Data entity model?

开发者 https://www.devze.com 2023-01-09 18:41 出处:网络
I\'m a pretty descent old school ASPNET developer i.e I still use Visual studio 2005 & webforms to build websites.

I'm a pretty descent old school ASPNET developer i.e I still use Visual studio 2005 & webforms to build websites.

But with all the recent MVC hype I decided to get a copy of VS 2010 express and get aquainted with 'New school' ASPNET development.

I have always relied on datasets to build my n-tier my web apps but VS 2010 has introduced me to new ORMs i.e Linq to SQL & Ado.Net Data entity model.

So now I'm confused on which one to use. Microsoft must had a reason to provide us with the 3 options...I just need to know w开发者_如何学Pythonhen & why to use which model.


ADO.NET is not a ORM, but the question was about ADO.NET Datasets which provide an ORM facility largely equivalent to what the Object Relational Designer provides for LINQ to SQL.

With respect to N-tier design, ADO.NET DataSets provide a means to separate the data classes from the data access classes into two separate assemblies. This means that you can use the data class assembly in your presentation tier, with out needing to reference the assembly containing the data access classes which should be used only by the middle tier. The O/R Designer allows you to specify separate namespaces for the data context and entity classes but doesn't provide a capability to put them into separate assemblies. So, from that perspective Datasets allow a cleaner n-tier design.

The main advantage that LINQ to SQL provides is not that it's entity classes are better than data tables, but rather the OO querying capability that LINQ provides and the dynamic generation of the SQL code.

Microsoft is a large organizition; its common for different parts of the organization to be working on products that originated from different contexts but end up competing.


Go with either Entity Framework or ADO.NET. Linq2SQL is being replaced by Entity Framework and is deprecated.

ADO.NET is not an ORM, so if you do want to learn about those, you should use EF.


I think it will come down to following facts

  • Size of project
  • Maintainability
  • Scalability
  • Knowledge level of developers

If you are developing a small website, there is no need to opt anything for the sake of new technology. It is always good decision to stick with what you know, and whilst learn new things. Only bring those newly learned weaponry, once you are confident about it; otherwise it will hit back!

##MVC or Web Form If you are not sure about MVC or Webform, watch these videos

  • [Choosing the Right Programming Model][2]
  • [Choosing between ASP.NET Web Forms and MVC][3]

##Choosing ADO.NET - LINQ to SQL/Entity Framework/DataSet

FYI all of them are part of ADO.NET. Assuming you are going to develop .NET 4, so you can look at the LINQ to DataSet feature; considering you previous experience with DataSet.
Entity Framework is also a good choice, only if you are comfortable with not writing any kind of SQL Query(classic T-SQL query) :-)

Check this new post in ADO.NET Team blog - "[Absolute Beginners Guide to Entity Framework][1]"

I would suggest, that do some research and find out yourself, which is better and why..

Cheers!!! [1]: https://web.archive.org/web/20160715043723/http://blogs.msdn.com:80/b/adonet/archive/2010/07/19/absolue-beginners-guide-to-entity-framework.aspx [2]: https://learn.microsoft.com/en-us/aspnet/web-forms/videos/how-do-i/choosing-the-right-programming-model [3]: https://web.archive.org/web/20110213203540/http://videos.visitmix.com:80/MIX09/T23F

0

精彩评论

暂无评论...
验证码 换一张
取 消