CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Glenn Block


Dispelling some urban legends about LINQ to SQL

Scott has a great post where he dispels the following two myths about using LINQ to SQL.

  • LINQ to SQL requires you to start with a database schema.
  • LINQ to SQL requires your classes to implement INotifyPropertyChanged and use EntitySet<T> for any associated collections.

Looking at the post I think he also added in dispelling a third legend, though he didn't explicitly call it out.

  • LINQ to SQL requires you to use custom attributes in your code and cannot work with a simple poco.  (In other words, LINQ to SQL supports persistance ignorance!)

Personally I have not used LINQ to SQL yet, though I do intend to play with it at some point. I know I have talked to many folks (including friends at Thoughtworks) and I have heard it far easier to grok and use than some other Entity frameworks :)

On the intuitiveness said, I am sold. It took me about five minutes of looking at sample code to understand how to use it.

Thanks for this post Scott!


Published May 18 2008, 11:26 AM by Glenn Block
Filed under:

Comments

Arjan`s World » Blog Archive » LINKBLOG for May 18, 2008 said:

Pingback from  Arjan`s World  &raquo; Blog Archive   &raquo; LINKBLOG for May 18, 2008

# May 18, 2008 4:59 PM

Jimmy Bogard said:

Just write real big:

LINQ to SQL supports Persistence Ignorance!

36pt font, bold, Comic Sans (for effect)

# May 18, 2008 7:44 PM

Justice~! said:

Yeah, LINQ to SQL is okay if your domain is *VERY* basic.  According to the post you linked, if you're not using IPropertyChanged and EntitySet you're writing your own lazy loading scheme!  Um...=)

# May 19, 2008 1:02 AM

Jon Limjap said:

Glenn,

Do you have a link somewhere illustrating how LINQ to SQL can be used with POCOs?

# May 19, 2008 2:26 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Glenn Block

Glenn Block is the Technical Product Planner for the Client UX program at patterns & practices. As Product Planner he is responsible for driving the vision and creation of p&p client deliverables including the Web Client and Smart Client software factories. Prior to joining Microsoft, Glenn has lived in various roles being "in the trenches" with developers, including being responsible for the overall architecture and technology direction. He has worked in both large and small organizations building enterprise systems for financial services, manufacturing, and print & mail on multiple platforms including .NET and Java. His technology passions are in software frameworks, architecture and systems integration. He resides with his wife and 3 year old daughter in Seattle (his other passion). Check out Devlicio.us!

This Blog

Syndication

News

View Glenn Block's profile on LinkedIn

Me