Interview questions

Benefits because LINQ is unitive

The Essence of LINQ

Chapter 3
The Essence of LINQ
Reproduced from the book Essential LINQ. Copyrightã 2008, Pearson Education, Inc., 800 East 96th Street, Indianapolis, IN 46240. 

<<Previous  Next>>


Unitive

Before LINQ, developers who queried data frequently needed to master multiple technologies. They needed to learn the following:

  • SQL to query a database
  • XPath, Dom, XSLT, or XQuery to query and transform XML data
  • Web services to access some forms of remote data
  • Looping and branching to query the collections in their own programs

These diverse APIs and technologies forced developers to frantically juggle their tight schedules while struggling to run similar queries against dissimilar data sources. Projects often encountered unexpected delays simply because it was easier to talk about querying XML, SQL, and other data than it was to actually implement the queries against these diverse data sources. If you have to juggle too many technologies, eventually something important will break.

LINQ simplifies these tasks by providing a single, unified method for querying diverse types of data. Developers don’t have to master a new technology simply because they want to query a new data source. They can call on their knowledge of querying local collections when they query relational data, and vice versa.

This point was illustrated in the preceding chapter, where you saw three very similar queries that drew data from three different data sources: objects, an SQL database, and XML:

As you can see, the syntax for each of these queries is not identical, but it is very similar. This illustrates one of LINQ’s core strengths: a single, unitive syntax can be used to query diverse types of data. It is not that you never have to scale a learning curve when approaching a new data source, but only that the principles, overall syntax, and theory are the same even if some of the details differ.

You enjoy two primary benefits because LINQ is unitive:

  • The similar syntax used in all LINQ queries helps you quickly get up to speed when querying new data sources.
  • Your code is easier to maintain, because you are using the same syntax regardless of the type of data you query.

Although it arises naturally from this discussion, it is worth noting that SQL and other query languages do not have this capability to access multiple data sources with a single syntax. Those who advocate using SQL or the DOM instead of LINQ often forget that their decision forces their team to invest additional time in learning these diverse technologies.


<<Previous  Next>>

Also read

Aspect-Oriented Programming

Explain the concepts and capabilities of Aspect-Oriented Programming, AOP.
What is Aspect in AOP?
AOP approach addresses Crosscutting concerns. Explain
The components of AOP are advices/interceptors, introductions, metadata, and pointcuts. Explain them
AOP vs OOPs...........



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring