Feeds

Introducing Microsoft LINQ

A new approach to data query in the .NET world.

Security and trust: The backbone of doing business over the internet

Book review Microsoft's Language Integrated Query (also known as LINQ), is one of the key features on the .NET horizon. Already out as a beta, it's slated for release as part of Visual Studio 2008 (which goes under the code name of Orcas, which conjures images of packs of killer whales rather than shrink-wrapped development software).

However, Microsoft has done a good job of whetting developers' appetites, and there's plenty of interest in LINQ already.

As the name implies, LINQ integrates query capabilities (both relational and XML querying) into the key .NET programming languages C# and Visual Basic. This moves way beyond supplying useful and highly functional APIs for querying relational and XML data stores and gets us into the realms of structured querying as syntactic elements of C# and VB. With LINQ, you write very high-level code that embeds queries that are compiled as part of the language. And no, it's a lot more than simply embedding SQL or XQuery strings into your applications.

Obviously, there's a lot that has to go on under the covers for all of this to work – you need more than a generous sprinkling of syntactic sugar for it to piece together. This book takes a stab both at showing how LINQ works and at investigating the changes in C# and Visual Basic and the next generation of .NET that enable it to happen. But the starting point is explaining what LINQ is, so the first chapter includes a round-up of LINQ, showing what it is, how it works, and offering some examples of the different flavours of LINQ (objects, XML and ADO.NET).

More detailed chapters follow this, on the specific implementations in C# and Visual Basic. In the case of C# there's a quick run through of language features introduced in version 2.0 and then on to the major new features included in C# 3.0, including type inference, lambda expressions, extension methods and, of course, query expressions. There's a corresponding chapter devoted to Visual Basic 9.0, which includes a section on feature differences with C# 3.0.

Once these preliminaries are out of the way the emphasis is firmly on LINQ again, with a long chapter on details of the syntax, including the query operators (including filtering, joining, aggregating and so on that you're familiar with from SQL) and conversion operators (which enable you to treat the result of a query as a List, Enumeration, Dictionary etc). LINQ to ADO.NET also gets a chapter, which provides a link between LINQ and the primary existing .NET mechanism for interfacing to relational data. LINQ to XML also gets a chapter.

It's not just in getting to the data easily that LINQ provides value; it's also in bridging the gap between the relational view of the world and object view (computer scientists like to call this the impedance mismatch, which confuses electrical engineers no end). The need to be able to persist objects to relational databases is the sort of thing that is normally handled by an object-relational mapping (ORM) layer (and in the Java world it's Hibernate that is the best known ORM solution). LINQ provides a new take on this too, making it even more of an attractive proposition.

However, while there's a lot of good material in this book, and it does indeed provide a fairly wide introduction to LINQ, it's not exactly a gripping read. The book is a bit dry and manual-like, with large chunks of syntax-related reference material.

Introducing Microsoft LINQ

Microsoft LinqVerdict: If you're desperate to get a handle on LINQ (and remember, it's still only in beta), then this is sure to hold your interest.

Authors: Paolo Pialorsi and Marco Russo

Publisher: Microsoft Press

ISBN: 0735623910

Media: Book

List Price: £23.99

Current Reg price: £15.83 inc. VAT (discount 34%)

Buy this book at Register Books at Reg Developer's special discounted price (subject to change). ®

Security and trust: The backbone of doing business over the internet

More from The Register

next story
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
Mozilla shutters Labs, tells nobody it's been dead for five months
Staffer's blog reveals all as projects languish on GitHub
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
Protecting users from Firesheep and other Sidejacking attacks with SSL
Discussing the vulnerabilities inherent in Wi-Fi networks, and how using TLS/SSL for your entire site will assure security.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.