vesuvius wrote:
The rant about Linq to SQL is a valid and pertinent one. Yes linq is abstract and passive but no-one is stating the real world problems with using it. That is the problem with being passive. This is the problem when you try things out, you miss the small details that make working with Linq or anything for that matter an absolute headache.
I will give you a few examples.
- Try and databind to anonymous types using a winfoms datagrid view and have CRUD and formating of the datagrid view. Ensure that this using modulable patterns and practices. Compare the volume, cleanness, understandability and separation of this code, and lets say, table adapters
- Try to databind to custom business objects in another layer
- Proceed to use the SetColumnError method using Linq validation and you soon find that you have to write oodles of code
For the first issue, how do you see data binding to anonymous types as a LINQ problem? Quite frankly if you're data binding, maybe you shouldn't be using a shortcut like anonymous types? Especially with all the restrictions placed upon it, wouldn't it be better to have your own class that you can add to rather than an anonymous class made by the compiler sometime down the line?
Again with 2, how is this a LINQ issue, maybe I'm just missing the connection here, but there shouldn't be any difference between a custom business object populated manually and one populated by LINQ. Now if you were wanting CRUD back to a database, then there will always be more steps to take when using an object, regardless of whether LINQ is there or not.
From everything I've seen and read about LINQ, at least currently, is not designed for (two-way?) databinding. There are ways to implement databinding through LINQ, there's even a library produced by a MVP Paul Stovell for performing complete databinding through LINQ:
SyncLINQTo me LINQ seems akin to WCF and the Sync Framework where what is provided doesn't specify everything, if you're dealing with more advanced concepts, propietary data sources, etc you have to write a client or sync endpoint to work with the underlying technology.
This is especially prevelent when you look to see what LINQ to x are out there (SharePoint, Amazon, Entities, etc).