Browse DevX
Sign up for e-mail newsletters from DevX


Platform Proliferation Powers PDC 2005 : Page 2

Microsoft's 2005 PDC conference introduces new platforms, language extensions, and more preview code than anyone could reasonably hope to become familiar with. Further, new capabilities are being touted for every major product, beginning with the upcoming Windows Vista client OS and extending to servers, languages, Office, and nearly every developer product. Read on for all the technical highlights, plus a full implementation example of the new LINQ data query feature.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Office and IE 7
In addition to support for the default XML file formats announced earlier this year, Office 12 gains a new dynamic toolbar, largely intended to make those features more apparent. Allchin said in surveys asking users what features they'd most like to see in Office, users frequently requested existing features—unaware that they existed, hidden under too many menu layers.

In Office 12, when you click on a menu in Word or Excel, rather than dropping down a menu as in previous versions, the toolbar area changes, making all the common tasks available through point-and-click. But perhaps the most appreciated feature was the "hover preview," which applies non-stick formatting or visual effects to selected text or objects by simply hovering over one of the buttons on the toolbar. For example, by first selecting text in a Word document, and then hovering over a font type on the toolbar, the selected text changes to provide an instant preview of how the document would appear if you actually applied that font. Hover over a different font, and the selected text changes to that font. Similarly, in Excel, you can hover to preview the way a table would look with any of the built-in table formatting styles.

For developers, Visual Studio Tools for Office 2005 (VSTO) provides a visual design paradigm, integration with .NET controls, and convenient managed-code wrappers for the underlying COM objects that power the Office suite. In a private interview, Eric Carter, a lead developer on the VSTO team and coauthor (with Eric Lippert) of the soon-to-be-released C#-focused book Visual Studio Tools for Office, revealed that the new version was designed to get professional developers interested in building Office applications, giving them the tools for enhancing and customizing the major Office suite applications. VSTO 2005 developers can target Word, Excel, Outlook, and InfoPath; Carter said that future plans include adding support for PowerPoint and Access, as well as more powerful managed-code interfaces.

IE 7 (finally) adds tabbed browsing and RSS capabilities as well as phishing scam prevention and other security enhancements. One nice feature is that the browser will scan any page for RSS feeds and then you can subscribe to them easily from a dropdown list.

Language Innovations
Of course, no PDC would be complete without announcements about upcoming enhancements to the programming languages themselves. For those who still like to code, the most important announcement was the Language Integrated Query (LINQ) project, which aims to add XML, database, and object query capabilities directly to C# and VB.NET, obviating the need to learn separate query languages such as XPath, XQuery, or SQL, and ancillary technologies such as ADO.NET or ODBC.

By adding query capabilities directly to languages, developers also enjoy compile-time checking and Intellisense features. Anders Hejlsberg and Don Box showed a code-centric demo that retrieved a list of running processes on a machine, extracted and sorted the ones using a working set (memory) exceeding 1024 x 1024 x 4, and then combined the resulting list with a text description drawn from a SQL Server database, using C# code that looks like this:

ProcessDescriptionDb db = new ProcessDescriptionDb(); var query = from p in Process.Getprocesses() where p.WorkingSet > 1024 * 1024 * 4 orderby p.WorkingSet descending select new { p.ProcessName, p.WorkingSet Description = ( Fom d in db.processDescriptions Where d.processName = p.ProcessName Select d.Description ) }; foreach (var item in query) Console.Writeline("{0,-30}{1,10:N0} {2}", item.ProcessName, item.WorkingSet, item.Description);

The code outputs a formatted list of the selected items and their descriptions.

One particularly interesting portion of LINQ is XLinq, which provides both DOM and XPath/XQuery XML capabilities. For example, suppose you represent a set of employees in XML, such as:

<employees> <employee> <id>1001</id> <name>John Doe</name> </employee> <employee> <id>1002</id> <name>Jane Doe</name> <department>Marketing</department> </employee> … </employees>

Using XLinq in VB.NET you can assign the XML directly to a variable—maintaining the formatting you'd prefer—for example:

Dim emps as XElement = <employees> <employee><id>1001</id> <name>John Doe</name><department>Sales</department></employee> <employee><id>1002</id> <name>Jane Doe</name><department>IT</department></employee> … </employees>

You can even mix variables and expressions into the XML, using the <% %> syntax familiar to ASP and ASP.NET developers. For example:

Dim aPhoneNumber As String = "111-222-3333" Dim emp as XElement = <employee><name>John Doe</name><phone><% aPhoneNumber %></employee>

Currently, you'd use an XML parser to extract the employee names from the XML and display them in a listbox. With LINQ, developers can write code such as:

For Each Dim empName In emps...name lstNames.AddItem(emp.Value) Next

Author's Note: The dots in the preceding code aren't used to indicate missing content, they're a descendants syntax indicating that the code should search for all <name> elements that are descendants of the <employees> element at any depth.

Equivalent capabilities exist for C#. To find out more, read the information available on the VB.NET future developments page.

I've saved the best part for last. Although these new features are targeted at the next versions of VB.NET (9.0) and C# (3.0), you can explore LINQ's features using the latest beta of Visual Studio 2005 right now—you don't have to wait until the next version! The Technical Preview download contains pre-release versions of the various components of the LINQ Project and compilers for both C# and VB.NET, and will work with the release versions of VS 2005 as well.

Download the technology previews for LINQ in either Visual Basic or C#.

A. Russell Jones is the Executive Editor of DevX.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date