Home > Microsoft .Net Development News > Ten cool Visual Studio Orcas features, part 2
Microsoft .Net Development News:
EMAIL THIS

Ten cool Visual Studio Orcas features, part 2

By Brian Eastwood, Site Editor
30 Mar 2007 | SearchVB.com

Office Development Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Visual Studio Orcas, due for release at the end of 2007, promises numerous improvements for Visual Basic, a data query called the Language Integrated Query (LINQ), a new Entity Framework for ADO.NET and updated tools for ASP.NET AJAX and Office 2007 development.

This two-part series examines ten of the IDE's new features as they were explained during sessions at DevConnections 2007. Part 1 looks at the improvements to the IDE and the aforementioned ADO.NET Entity Framework. This article looks at what's new in Visual Basic 9 and LINQ; as you will see, these two concepts are closely related.

LINQ: The Language Integrated Query

In Visual Studio 2005, querying a dataset typically involves a stored procedure, a newly created view and a bit of ADO.NET filtering. This is the case because data exists in rows, while .NET code deals with objects. "They are always two different worlds," said Jeff King, a program manager on the Visual Studio team. "LINQ puts queries inside the languages and merges the worlds together."

At its most basic level, the Language Integrated Query, a feature of both Visual Basic and C#, uses the concept of the SQL Select statement to make its queries. However, there are two important differences, said Markus Egger, president and chief software architect at EPS Software Corp. and publisher of CoDe Magazine.

First, LINQ statements begin with a From statement instead of the Select statement. By listing the data source first, IntelliSense is triggered, Egger said.

Second, since C# and Visual Basic are object-oriented languages, he said, "whatever you can express in C# or VB you can make part of LINQ queries." This encompasses anything that is IEnumerable -- entities, collections and even XML. Moreover, since the queries are being made in an object-oriented environment, Egger said, "you can do very, very complex things that result in a completely different result set," such as calling up an instance of objects that did not exist in the source at all.

LINQ also brings about the introduction of several new language concepts for Visual Basic and C#. The expression tree, for example, is a data representation of the LINQ expression that bridges the gap between the .NET code and the SQL Server. In addition, property initialization makes it possible to create an object and set its properties in a single line of code.

Other new language concepts, which will be discussed below, include implicit types and extension methods.

VB 9: Implicit types

In a nutshell, author and consultant Billy Hollis said, implicit types provide strong typing without forcing developers to figure out the type they need. The compiler does the work for them, since the type is inferred from the initializer expression.
More on Visual Studio Orcas
Learning .NET: Get started with LINQ development

Visual Basic's future: LINQ, Orcas and, yes, VB 6

Learning Guide: LINQ and C# 3.0 (TheServerSide.NET)

Implicit types work well when looping through a collection, Hollis said, since in such a scenario a developer is likely to be looking only for a key and a value and will not know, or care, what is the index type.

In addition, inferring types makes it possible for extensions to bind to data types such as XML. This is fundamental to making LINQ work, Hollis said.

VB 9: Extension Methods

Extension methods, which Hollis described as "syntactic sugar," are another Visual Basic 9 feature coming straight from LINQ, since all LINQ query operators are extension methods. These methods are marked with custom attributes and are then added to other objects automatically (so long as they are not already there).

Hollis said extension methods can be used just about anywhere a developer would use a normal function. However, they cannot contain optional parameters, parameter arrays or generic arguments that have not been typed. Also, late binding cannot be done with extension methods, he said.

VB 9: IntelliSense

IntelliSense, already referred to as "Intellicrack" in some development circles, is set in Visual Basic 9 to encompass keywords, member variables and anything in scope. "Anything that would make sense there, IntelliSense will put it in," Hollis said.

Moreover, IntelliSense will work with implicit types, once the compiler has figured out what is they type, Egger said.

In addition, LINQ, as stated, is set up to take advantage of IntelliSense. In SQL syntax, the Select query comes first, but in LINQ, the From statement comes first. With the data source listed first, IntelliSense has a chance to kick in.

Finally, as mentioned in Part 1 of this article, Visual Studio Orcas has added JavaScript IntelliSense to accommodate ASP.NET AJAX development.

VB 9: Relaxed delegates, initializers and more

For additional information on what's new in Visual Basic 9, including relaxed delegates and initializers, check out the MSDN article Overview of Visual Basic 9.0. The emphasis there is on productivity gains developers can expect to enjoy when building data-oriented applications with an increasingly dynamic language.

Tags: Visual Studio 2008 and Language Integrated Query (LINQ).NET Framework 3.5 and Visual Studio 2008 developmentVIEW ALL TAGS

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Visual Studio 2008 and Language Integrated Query (LINQ)
Run Visual Studio Web Tests from a Team Foundation Server Build
LINQ in Visual Studio 2008 addresses object data modeling
LINQ Learning Guide: Third-party LINQ Implementations
LINQ Learning Guide: LINQ to Entities
LINQ Learning Guide: LINQ to SQL
LINQ Learning Guide: LINQ to DataSet
LINQ Learning Guide: LINQ to Objects
LINQ Learning Guide: LINQ Providers
LINQ Learning Guide
LINQ Learning Guide: LINQ and Visual Studio 2008's new language features

.NET Framework 3.5 and Visual Studio 2008 development
Microsoft's message at TechEd: make the most of what you have
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Moonlight 1.0 release brings Silverlight to Linux
Microsoft cuts Visual Studio 2008 upgrade prices as VS 2010 looms
User Account Control (UAC): How to develop code for standard users
How to write installers in Vista that work correctly under UAC
How to elevate programs' privileges correctly using Vista's UAC
Introduction to Vista's user account control (UAC) for developers

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
LINQ  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Development Solutions - Silverlight, WinForms, ASP.NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts