Tuesday 24 April 2012

Linq To Sql

LINQ to Sql  interact and provides query capability to relational database.

Architecture of LINQ to sql consists of :

Object Model - It consists of Data Context and Data Entities. Data entities are the partial classes generated by Linq to sql. Data context define connection to the database.It maps data entities with databae tables and
fills the objects into generic collection type called Table<>. It also maps Stored Procedures and user defined functions.
 
Object Relational Designer  

Runtime
 
Key Features of Linq to sql :-

1)Generating Object Model From db -  Linq to Sql connects to sql server db and creates ObjectModel by dragging  and dropping tables from the server explorer.

2)Stored Procedures and user defined functions support - linq to sql supports stored procedures and user-defined functions by generating corresponding methods in DataContext.

3)Framework compatibilities - linq to sql is part of .Net framework 3.5 and higher.

Strengths :-

1)Linq to sql queries are well-integrated with programming lang. this helps in avoiding Sql Injection attacks.

2)Uniform syntax for working with various data sources like xml, relational datastores like sql server.

3)Improve app. dev by proving Intellisense, compile time syntax checking and debugging support.

4)Support compiled queries and stored procedure to enhance the overall performance of db operations.

Weakness:-

1)Linq to Sql only works with Sql Server Db.

2)From main object, navigation to foreign key, reference object is not possible.

3)It supports only bottom-up design i.e database to object oriented and not the other way.

Summary :-

It overcome several drawbacks of Ado.Net by providing single uniform type query language to query relational and non relational datastores in obj oriented manner. User friendly object oriented syntax, highly
optimized for MS sql server.




No comments:

Post a Comment