Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

.NET

An Interview with Amanda Silver on Language Integrated Query (LINQ)


DDJ: An area that I've had the opportunity to personally spend some time with is DLINQ, which seems to have come a long ways.

AS: The biggest thing we've done in this most recent CTP is included a graphical designer. This is going to make working with the DLINQ API much easier instead of working with the SQLMetal command-line code generation tool [ Editors note: SQLMetal is described in this early DLINQ document]. With the graphical designer, you just add DLINQ objects with the Add Item template, and you can just drag tables from the server explorer onto the designer surface. That automatically generates all of the DLINQ objects that you need.

DDJ: One of the things that I noticed is that the code that gets generated is an order of magnitude smaller than what's generated for a Typed Dataset. It's really just generating business objects, decorated with some attributes, which map to the table definitions.

AS: Right. Exactly. And then the DLINQ runtime comes along when you execute the query and translates it to SQL to get whatever information you want from your database.

DDJ: There's one thing that I really liked about the DLINQ, and I don't know a better way to put it than to say that it just really felt right when using it.

AS: Ok...

DDJ: Right now when you're working with database, you have Typed Datasets, and Table Adapters, so you have a somewhat strongly typed experience. But then when you get data into your application and you want to do BindingSource, or you want to call the DataTable's Select method, at that point it's all loosely typed. You're specifying column names as strings, it's not checked at compile time. One of the things that I like about DLINQ is that if you have a result set in memory, and you want to filter it down to something like just the customers in Washington, you just throw a Select statement against it. You get full Intellisense. It's compile-time validated. You're not making a copy of the data, you're just getting references to those objects back. It just feels good to use.

AS: It goes back to what we were discussing when we were talking about XML a minute ago. What the user really wants is compile time syntax checking, compile time schema checking, and Intellisense to guide them through the query that they're writing or the XML that they're writing. That's what you get with DLINQ. The other thing is that basically with LINQ, getting back to the whole crux of the project, you have the same code, or the same programmatic construct, for querying against database, XML, or objects. So the query that you would write against SQL with DLINQ would be written the same as a query against a collection of processes or files in the file system.

DDJ: That's what I meant about it just feeling right. A Select statement just feels like the right way to get a subset of information, so whether it's a set of files in a directory, or processes in memory, or anything like that, it has an elegant feel to it. The Intellisense and the strongly typed nature make it really nice to work with.

AS: Now that you have this way to query data within the object space, I think that people will approach program writing differently.

DDJ: Right.

AS: I don't know if we talked about this last time, but I had some interns last summer, and I was trying to get them to implement a project with Datasets and all of that stuff. Their whole approach to the project, even before we sat down to design it, was search. They already fundamentally understood how to query. In the current environment with computers, everyone is search based as part of their daily operations. When you add it to the programming language I think you'll find that new programmers think in terms of search and query pretty naturally.

DDJ: I agree. I think it does map to the real-life experience of how people work. Even non-programmers now innately understand the concepts of search, filter, and sort. They're using those concepts on a daily basis.

AS: Take something like Outlook. There are a lot of Outlook users who are not programmers, but they can create views of their data to help extract information. When you add those constructs to the programming language, it's not a far leap to think that pretty soon we could be expressing those filters in terms of VB code. And then people can modify it if they're not satisfied with what was generated by the visual tool.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.