views:

92

answers:

3

Is it worth spending time in these frameworks. Or they just another framework like microsoft developed in the form of MFC library. I dont want to waste precious time, so please help. Under what scenarios these frameworks will be helpful.

+1  A: 

EF and L2S are Object-Relational Mappers (ORM). They would be used wherever an ORM is used. StackOverflow uses Linq to SQL as its ORM layer, to good effect. Entity Framework is up-and-coming, and although it currently has issues, it will be greatly improved in the upcoming version 4.0.

Your time would be well spent learning one or both of these frameworks, as it will be highly likely you will use an ORM in your applications at some point.

Robert Harvey
You really recommend spending time learning LinqToSql after Microsoft has basically back burnered it in favor of Entity Framework? I don't think I can agree with that advice. Why learn a feature poor ORM (relative to its competition) that is never really going to be much better than it is today?
Michael Maddox
@Michael: EF 4.0 requires Visual Studio 2010 and .NET Framework 4.0. For some people, that's not going to be a viable choice, for configuration reasons. If you need more features today, your best choice might be nHibernate, or one of the other open-source ORM's. If you need a lightweight ORM and are uncomfortable with Linq to SQL, Subsonic might be a viable alternative.
Robert Harvey
+1  A: 

YES! It is worth Learning. No! its not just another framework. It is useful for any application that uses a SQL Database to query data and present/do some logic.

Linq2Sql was introduced with .NET 3.5. Very useful if you dont have your own set of domain entities. A bit difficult to map Linq2Sql classes to our own domain entity classes in complexed scenarios.

But, recommend to use Entity Framework. EF was introduced with .NET 3.5 SP1. Much improved version of Linq2Sql and came as part of Olso Mixed Models. This can be used as a real ORM to map our own set of domain entities and the designer provides most of the features.

There is a new version of EF (EF4) ships with .NET 4.0. Watch Evolving ADO.NET Entity Framework in .NET 4 and Beyond for what you can do with EF4.

Download the "Layered Architecture Sample for .NET" from Codeplex.com

Kosala Nuwan
I believe LinqToSql came out with .NET 3.5. I believe Linq will run against .NET 3.0. I think saying EF 3.5 is better than LinqToSql is a somewhat controversial opinion (the market has overwhelming voted for LinqToSql).
Michael Maddox
Yes, you are correct L2S came out with .NET 3.5 (http://msdn.microsoft.com/en-us/library/bb386976.aspx).And again Yes, it is arguable (http://stackoverflow.com/questions/8676/entity-framework-vs-linq-to-sql).
Kosala Nuwan
+1  A: 

It really depends on what your alternative is. If your alternative is using ADO.NET and DataSets, then yes, LinqToSql and EntityFramework are likely a step forward. If your alternative is NHibernate or another feature rich ORM, then they may be a step backward.

Microsoft has really strongly moved away from LinqToSql while still continuing to offer support for it and making minor changes. Microsoft is recommending all LinqToSql users move to Entity Framework. However, the Entity Framework that came out with VS 2008 SP1 / .NET 3.5 SP1 was in many ways a step back from LinqToSql. The Entity Framework that is coming out in April with VS 2010 and .NET 4.0 should be mostly an upgrade from LinqToSql, assuming you can migrate to VS 2010 / .NET 4.0 sometime in the near future.

Michael Maddox