Linq to SQL Wish List

As we are not Microsoft marketers, we tend to see the cons of the products that Microsoft builds. As every product has its flaws, of course Linq to SQL is no exception. Here is my list of the things that I compiled from various sites & forums or hit a limitation block by myself:

A) Architecture

1 – Enabled Provider Model & More providers than SQL

Since Matt Warren has explained in his blog post that LINQ to SQL supported multiple providers internally, but it was disabled for some “non-technical” reasons there is an unstoppable desire in each of us to see it enabled in the next version. (I am not even asking for Persistance Ignorance)

2 – Fully Mockable, A Design by Contract Framework

If this happened, we wouldn’t look for hacks like this one. I want to be able to mock DataContext out without doing any funky tweaks.

3 – A Disconnected Data Context

I can not remember how many times I have seen this everywhere. This DataContext will be able to be serialized & deserialized somewhere and even if it is dead, we should be able to benefit from Object Tracking and Deferred Loading.

By this I mean a stateless DAL, where I don’t have to say “delete these children” or “update these but not these”.

4 – Support for more inheritance models

Currently only Table per Hierarchy model is enabled, multiple entities constituting 1 table or vice versa are not.

5 – Out of the box many to many relationships

Title explains, as we currently can’t do this mapping.

6 – Batch Statements Execution

Currently Linq to SQL sends multiple queries to the DB if an operation needs it. A batch statement like NHibernate’s would have been more than cool.

7 – More control on the resulting statement

Advanced users should be able to sneak in the generation or submission process – like the interceptors in NHibernate again.

B) Tools and Designer

1 – Code generation into different structures

The ability to separate each entity and DataContext into different files or assemblies. Partial files do not let us reside our extensions in different assemblies.

2 – Make DBML designer support giving Entity Base Class

SQL Metal has this, so why does the designer not?

3 – Make DBML designer support external mapping

Again, this is a SQL metal specific “magic”.

4 – Enable partial generation in SQL Metal

Sometimes we human beings do not want to generate all the database, just one table for instance.

This is usually followed by a request on being able to “refresh” an object on the design surface. I don’t know anybody who fancies to delete & drop from connection explorer each time something is changed in the db and loose custom associations.

It would also be good if user changes to designer are kept, not overridden everytime by the tool (a smart merge may be?).

5 – A tool to generate POCO translators from/to Linq Entities

This could be configured in code or via XML files. Some of us (including me) are using Software Factories to generate them; it would have been nice to have an out of the box support in Visual Studio.

That’s all I can remember of at the midnight. What would you like to have in this list apart from these?

kick it on DotNetKicks.com

Share it on: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Blogosphere News
  • e-mail
  • YahooMyWeb
  • DotNetKicks
  • DZone

23 Responses so far »

  1. 1

    Terry said,

    June 5, 2008 @ 5:41 am

    Architecture #6 - Check out my article at http://www.aneyfamily.com/terryandann/post/2008/04/Batch-Updates-and-Deletes-with-LINQ-to-SQL.aspx

    Think I might have something you’d like.

  2. 2

    Sidar Ok said,

    June 5, 2008 @ 9:01 am

    Hey Terry - thanks for the comment, I’ll definitely check your article & comment in a while.

    I want these features out of the box, most of them can be implemented manually anyway. e.g for tooling, unplugged is not doing a bad job, and we already are able to write multitier applications without disconnected data context.

  3. 3

    Harry M said,

    June 5, 2008 @ 9:08 am

    You might also liek to see the tool I developed for scripting changes to dmbl files. http://www.adverseconditionals.com/2008/05/introducing-linqtodbmlrunner.html

  4. 4

    Sidar Ok said,

    June 5, 2008 @ 9:48 am

    Hey Harry, definitely on my list !

  5. 5

    Fredrik said,

    June 5, 2008 @ 12:23 pm

    Check out my post where I show to write an IDataContext abstraction that makes mocking ++ of Linq2Sql easy: http://www.iridescence.no/Posts/Linq-to-Sql-Programming-Against-an-Interface-and-the-Repository-Pattern.aspx

  6. 6

    Sidar Ok said,

    June 5, 2008 @ 12:34 pm

    Hi Frederik,

    We still need to hack it to mock the provider that is tightly coupled to the data context and is internal.

    But to mock out other methods, agreed that it is the way to go.

  7. 7

    JV said,

    June 5, 2008 @ 1:21 pm

    So basicly you want the Entity Framework?

  8. 8

    Sidar Ok said,

    June 5, 2008 @ 1:43 pm

    JV,

    I was expecting this to come :)

    I want to have these and not to loose what I have with Linq to SQL already (better performance, more reliable designer & tools)

    And on top of everything, even EF itsself is still beta, and conceptual schema is mandatory where in Linq to SQL it is not.

    But as a result, yes, EF has some of the features listed but lacking some too.

  9. 9

    Richard said,

    June 5, 2008 @ 8:51 pm

    I hope Linq To Sql goes away and Entity Framework just replaces it.

  10. 10

    Mike said,

    June 5, 2008 @ 11:00 pm

    @Richard,
    You may have your wish come true soon enough:

    http://oakleafblog.blogspot.com/2008/05/is-adonet-team-abandoning-linq-to-sql.html

  11. 11

    Sidar Ok said,

    June 6, 2008 @ 5:30 am

    Mike,

    Damien Guard is a recently recruited guy to Linq to SQL team, so they are expanding the team. See his answer to this query on dotnetkicks:

    http://www.dotnetkicks.com/adonet/Is_the_ADO_NET_Team_Abandoning_LINQ_to_SQL

  12. 12

    JV said,

    June 6, 2008 @ 9:50 am

    LINQ To SQL is indeed not being abandoned. It simply has another purpose and focus then the Entity Framework, where LINQ to SQL is for less advanced developers and for quick stuff and EF for the more advanced stuff.

    But neither you should expect fancy stuff from it which you can do with EF. In my opinion it should stay simple (multiple databases would be great though).

  13. 13

    Sidar Ok said,

    June 6, 2008 @ 10:13 am

    I don’t agree that it is for less advanced developers. You can argue that ObjectDataSource s, Datasets yada yada are, but concepts behind Linq to SQL can be fairly complex.

    Handling Concurrency issues, Serialization matters, Mapping Engines,Deferred Loading & Object tracking issues, Extensibility points - these aren’t trivial tasks.

    Something that is easy and with not much friction to use doesn’t make it a product that advanced users can not benefit. I agree though, it should stay simple to use as it is now. Do you think any of the wishes in this list will add this complexity ?

    (I also find EF & Conceptual Schema idea too intrusive, btw. I pretty much share the opinions of frans bouma on this subject : http://weblogs.asp.net/fbouma/archive/2008/05/19/why-use-the-entity-framework-yeah-why-exactly.aspx )

  14. 14

    Wöchentliche Rundablage: Silverlight 2, WPF, ASP.NET MVC, jQuery… | Code-Inside Blog said,

    June 9, 2008 @ 7:01 pm

    […] Linq to SQL Wish List […]

  15. 15

    Weekly Links: Silverlight 2, WPF, ASP.NET MVC, jQuery… | Code-Inside Blog International said,

    June 9, 2008 @ 7:02 pm

    […] Linq to SQL Wish List […]

  16. 16

    liviu said,

    July 7, 2008 @ 9:41 am

    Hi, I think code generation is the problem. Maybe the whole plumbing code can be dynamically generated at runtime.

  17. 17

    Sidar Ok said,

    July 7, 2008 @ 11:50 pm

    @liviu - Why do you think code generation is the problem, once a good merger & manager is provided ?

  18. 18

    Tony said,

    July 24, 2008 @ 9:36 am

    I have implemented batching of LINQ to SQL queries at my blog at http://tonesdotnetblog.wordpress.com/2008/07/23/linq-to-sql-batches-and-multiple-results-without-stored-procedures-by-tony-wright/

  19. 19

    Kristofer said,

    July 30, 2008 @ 3:44 am

    Hi Sidar,

    You may find my DBML refresh add-in for Visual Studio interesting - it adds the ability to re-sync the DBML against the database… …described in more detail at http://blog.huagati.com/res/index.php/2008/07/07/tools-part-1

  20. 20

    Kian said,

    November 4, 2008 @ 5:41 pm

    Keep a good work man!,

  21. 21

    Alexandrea said,

    November 27, 2008 @ 7:31 am

    It is healthy, I shall come on your site more often, thank.,

  22. 22

    absesiagS said,

    March 20, 2009 @ 8:41 pm

    Was ist das?

  23. 23

    Sidar Ok said,

    March 23, 2009 @ 9:20 pm

    Das ist ein list fur besser linq to sql :)

Comment RSS · TrackBack URI

Say your words

You must be logged in to post a comment.