A Look at LINQ


I’ve been interested in LINQ for some time as I’m a bit fan of object relational modelling. I was initially introduced to the world of object relation mapping by a brilliant man by the name of Malcolm Young. He showed me that there was more than just the proverbial “ds.” and stored procedures. By using this framework, I noticed the ease at which applications were created. No longer are we hindered by the requirement of having to build a data tier. It’s also a lot nicer to do:


as opposed to:


One of the big arguments against using LINQ is the security risk of having developers directly accessing the database. I cannot disagree with this argument. With enterprise level projects, DBAs will most often have ownership over a database and tightly control the manner in which it is accessed. It is possible to restrict access to just stored procedures in some casesMy argument against that is that very often, business logic invariably finds its way into stored procedures. Maintaining stored procedures is also harder than managed code. Furthermore, my original observation still stands; it is much easier and nicer to deal with objects rather than datasets and datatables. You can always call a stored procedure from LINQ and get back an anonymous object to work with. Should you not lock down your database, there still is nothing stopping a developer from building dynamic SQL queries.While it’s still early days, I’m very impressed with LINQ and I believe it has real possibilities. I cannot see Microsoft including LINQ “just for the fun of it” ino .NET 3.5. Someone must have had the vision to see beyond the limitation of always having to build a data tier and calling stored procedures.

Technorati Tags:


2 Responses to “A Look at LINQ”

  1. 1 Jim

    I believe a compromise with DBA’s may be achieved through using LINQ generated read’s (i.e. read access to tables / views) while still using sprocs to manage creates / updates / deletes. Of course as confidence builds in LINQ I would expect DBA’s to allow LINQ to manage all CRUD operations.

  2. 2 alvinyong

    That’s an interesting thought, Jim. I believe you’re quite right. I can see how the object model will still be useful in handling and manipulating data and it should be straightforward to call stored procedures through LINQ to handle data modification.

    One thing I’m yet to fully explore is the transaction management for LINQ. I’m going to continue my mini project and find out more. This is quite an exciting tool that Microsoft has come up with.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: