Thoughts from Dan Miser RSS 2.0
 Friday, January 11, 2008

To be sure, this is an incomplete list, but it is a good start. Here's what I don't like about LINQ to SQL:

  • It only works with MSSQL. Yes, this point has been beaten to death, but it is entirely justified. Third party solutions don't cut it. LINQ to SQL intentionally seeks to exclude a sizeable population because of this hair-brained decision.
  • No way to easily specify adhoc LINQ queries. This doesn't count. I know the benefits of design-time queries, but I should also be allowed to shoot myself to get the added flexibility if I so choose. Building up expression trees is not a viable option for every day development.
  • The constant labeling of LINQ to SQL as an OR/M. That label considerably overstates what this technology does. One to one mapping between a table and a class is not really OR/M. It seems like they want to force you to change your database by writing stored procs and views to make your object model better.
  • There is no automated way to easily pick up changes to the database schema.
  • There is no easy way to preserve changes to the generated code. e.g. I change the name of the automatically generated class from collection_details to CollectionDetails, but I evolve the schema of the table. When I re-add the table, I need to set all of the custom properties again. I know I shouldn't change generated code, but see the next point.
  • Speaking of collection_details, it would be much better if the underlying class generator had some options to clean up legacy table names (e.g. remove underscores, camel case resulting table and column names).
  • No many-to-many support. In short, when you have an junction table (aka associative table or cross-reference table), you will need to write code like this: User.UserPermissions[0].Permission vs. User.Permissions[0]. Until we see LINQ to Entity (if ever), we do have this, but you can't use the new entity in a LINQ query.
  • There is no built-in solution to using LINQ across tiers. I don't want to expose my LINQ classes (see the point above about the tight coupling between database and objects) as I may want to change my database, and I don't want that cascading to all of the places that use it. There is also no diffgram, so even if I did it, I would have to write my own change tracking and resolving support. I went to an OpenSpaces meeting on this very topic during CodeMash, and the consensus was not flattering.

In short, it seems like this part of LINQ was released way before it was ready. But it does demo well...

Feel free to add your own grievance to the comments.

Friday, January 11, 2008 12:23:26 PM (Central Standard Time, UTC-06:00)  #    Comments [5] -
.NET | LINQ
Friday, January 11, 2008 1:23:52 PM (Central Standard Time, UTC-06:00)
Just use ECO (Enterprise Core Objects) : http://www.capableobjects.com/

ECO has everything that's missing from LINQ :

* works with multiple DBs
* you can write adhoc OCL queries
* real OR/M - start with your object model and map it automatically to a db
* supports wrapping of existing db
* automatic db schema evolution - one click
* supports many-to-many associations
* multi-tier ready with advanced features
* you can even use LINQ to Objects with ECO
Rossen Assenov
Friday, January 11, 2008 10:33:02 PM (Central Standard Time, UTC-06:00)
I've been using NHibernate a lot lately, but it looks like MS is really pushing hard on the LINQ To SQL front. The ASP.NET 3.5 Extensions download uses it very extensively, for example.

Thanks for the link to ECO, Rossen. I assume this is the same ECO that was in Delphi. I've been totally out of the Delphi arena for the past 13 months, so I was a little shocked to see it in product form for another company. I see Jonas is there, so I assume the CodeGear spinoff caused the ECO team to take things back? I will definitely check this out, though.
Saturday, January 12, 2008 3:57:04 PM (Central Standard Time, UTC-06:00)
Hi Dan,

The ECO team formed another company so they can bring ECO to VS.
ECO will still be available in Delphi.

Here are some links discussing this :

http://dn.codegear.com/article/36723
http://blogs.codegear.com/nickhodges/2007/07/09/37099

ECO is basically what Microsoft is trying to do with the Entities Framework and LINQ to Entities.

ECO has many advantages over both LINQ to SQL and Entities and it's very productive way of writing .net applications.

There is an ECO book on Lulu : http://www.lulu.com/content/311556

Rossen
Rossen Assenov
Sunday, January 13, 2008 3:05:39 PM (Central Standard Time, UTC-06:00)
Hi Dan,

I agree with you, LINQ to SQL has some serious shortcomings. I think is will go down as something that is great for wow effect in demos and is used to hack together applications quickly, but for real large development efforts there are many better alternatives such as ECO, Entity Framework or nHibernate.
Monday, January 14, 2008 10:42:01 AM (Central Standard Time, UTC-06:00)
I've also found it to be pretty slow. I'm currently using for bulk loading a database with legacy data, and even using CompiledQuery.Compile (which is pretty much essential) the app is definitely CPU bound when it's largely just an IO job.

Having said that I haven't used OR/M tools in .net before so it may be compariable to nHibenate speed ?!?
Comments are closed.
Navigation
Archive
<May 2008>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Dan Miser
Sign In
Statistics
Total Posts: 306
This Year: 21
This Month: 2
This Week: 1
Comments: 601
All Content © 2008, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)