LINQ and “DLinq”

Posts   
 
    
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 13-Sep-2005 20:56:16   

Greetings, In reading Paul Vick's Blog about LINQ, I came across this paragraph:

We will also be providing three implementations of the LINQ API patterns that cover 95% of the types of data that people need to query: relational, object and XML. First, we will provide a set of “standard query operators” that will make the interface IEnumerable(Of T), the fundamental collection interface on the .NET platforms, queryable. Second, we will provide a component called “DLinq” that implements a query-enabled object/relational mapping service which allows querying over remote relational data. And third, we will provide a component called “XLinq” that implements a very lightweight, query-enabled XML DOM. By hitting each element of the ROX equation, we believe we will provide a query solution for most situations right out of the box.

The blog also mentions

(It’s also important to note that these patterns are fully compatible with .NET 2.0 and require no additional platform features. They’re totally implementable in VS 2005, so you won’t need a new CLR to use them.)

This got me thinking about how this will influence a tool like LLBL ??

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 13-Sep-2005 21:43:27   

omar wrote:

Greetings, In reading Paul Vick's Blog about LINQ, I came across this paragraph:

We will also be providing three implementations of the LINQ API patterns that cover 95% of the types of data that people need to query: relational, object and XML. First, we will provide a set of “standard query operators” that will make the interface IEnumerable(Of T), the fundamental collection interface on the .NET platforms, queryable. Second, we will provide a component called “DLinq” that implements a query-enabled object/relational mapping service which allows querying over remote relational data. And third, we will provide a component called “XLinq” that implements a very lightweight, query-enabled XML DOM. By hitting each element of the ROX equation, we believe we will provide a query solution for most situations right out of the box.

The blog also mentions

(It’s also important to note that these patterns are fully compatible with .NET 2.0 and require no additional platform features. They’re totally implementable in VS 2005, so you won’t need a new CLR to use them.)

This got me thinking about how this will influence a tool like LLBL ??

I got the NDA-ed docs last week. Trust me, the stuff in Linq will not fully run on .NET 2.0. Some of it will, but for example lambda features aren't available in .NET 2.0, as well as many other things which makes the platform great.

For now, it wont influence anything, as it's not fully usable on .NET 2.0. For .NET 3.0, it will be the standard, and by then any o/r mapper will use the capabilities build into the Linq system.

Oh, their DLinq is not that great. It uses attributed based object mapping, but that's not what you want, because you can't use multi-database systems with that. Most O/R mappers which used attributed based mapping in the past are looking to move away from that. I really couldn't understand why they opted for attributed based mapping.

I really don't understand what Paul Vick means with 'it works on .NET 2.0'. I mean, can you create a thing like s => s < 5 ? and pass that to a Where construct? Or use 'var' ?

Frans Bouma | Lead developer LLBLGen Pro
wayne avatar
wayne
User
Posts: 611
Joined: 07-Apr-2004
# Posted on: 22-Sep-2005 22:38:52   

Hi Otis

I just watched the video with anders hejlsberg and LINQ AGAIN... Incase i misunderstood it or missed something. Earlier this week i commented on your blog, but at that time i was very "deur mekaar" confused about this topic and did not really understand it.

Can you please confirm that i am understanding this LINQ thing correctly now.

  1. LINQ is a language syntactily simular to SQL. This language can query anything that implements Interfaces derived from IEnumerable.. meaning it can query all objects that implement ICollection because ICollection inherits IEnumerable.

  2. DLINQ Is their answer to attributed based object mapping. It creates objects that implement ICollection therefor making it queryable by LINQ.

  3. XLINQ seems to be simular although i dont grasp it 100%.

So if LINQ can query anything that implements ICollection that means that you dont have to make any changes to LLBLGen because it already implements ICollection in the collections.

BUT...

Does that mean that you must return ALL 1 Billion entities in a collection and then let LINQ apply its predicate to it? frowning Surly not...
How does the LINQ predicate know to fetch data from a database Or is this where some changes to LLBLGen Pro is going to have to be made to support the LINQ language?

Now one final queastion. As you might now i use self servicing. if self servicing is simular to DLINQ's attributed based object mapping then what is your adapter version? The way i understand adapter is that the select, insert, update and delete logic is removed from the entitiy so that you have light entities that can be passed between Tiers. But isnt that still attributed based object mapping Adapter has Entities, properties (attributes)? confused

I will really appreciate if you can clear this up for me. I know you must be pretty tired of answering question about linq.

Wayne

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 23-Sep-2005 09:47:51   

wayne wrote:

Hi Otis

I just watched the video with anders hejlsberg and LINQ AGAIN... Incase i misunderstood it or missed something. Earlier this week i commented on your blog, but at that time i was very "deur mekaar" confused about this topic and did not really understand it.

Can you please confirm that i am understanding this LINQ thing correctly now.

  1. LINQ is a language syntactily simular to SQL. This language can query anything that implements Interfaces derived from IEnumerable.. meaning it can query all objects that implement ICollection because ICollection inherits IEnumerable.

Linq is a system which offers you to write new method types which can be used to create new resultsets from other sets. It doesn't do anything by itself, the system calls into the methods which do the filtering

  1. DLINQ Is their answer to attributed based object mapping. It creates objects that implement ICollection therefor making it queryable by LINQ.

DLinq is an implementation of methods working inside the linq system which provide o/r mapping (basic) functionality.

  1. XLINQ seems to be simular although i dont grasp it 100%.

XLinq is a way to work with XML in the same way as you'd do with other types of data structures. Though this is partly born from the fact that the XmlDocument interface in .NET is so incredibly crap.

So if LINQ can query anything that implements ICollection that means that you dont have to make any changes to LLBLGen because it already implements ICollection in the collections.

No, I have to write several things, for example methods which work inside the linq system which convert the lamda functions to predicates and convert the expression trees to queries, but that's it. Though the inner structure how to do things is a bit unclear, so I'll wait till they're fairly far in the development cycle.

BUT... Does that mean that you must return ALL 1 Billion entities in a collection and then let LINQ apply its predicate to it? frowning Surly not...
How does the LINQ predicate know to fetch data from a database Or is this where some changes to LLBLGen Pro is going to have to be made to support the LINQ language?

Linq doesn't know anything, it simply calls into the methods provided by what you specify in the from clause. If you specify from db.Customers, the db.Customers provides the methods. These won't work on a set in memory but on a set in the db, hence conversion to sql (it's not that simplistic but it will do for now wink ).

Now one final queastion. As you might now i use self servicing. if self servicing is simular to DLINQ's attributed based object mapping then what is your adapter version? The way i understand adapter is that the select, insert, update and delete logic is removed from the entitiy so that you have light entities that can be passed between Tiers. But isnt that still attributed based object mapping Adapter has Entities, properties (attributes)? confused

DLinq's architecture is one of a very basic O/R mapper: you have a central session/context which knows your model and you ask it to do stuff for you. In a way you can see it as adapter, but adapter is more sophisticated than that, as it also works disconnected and DLinq doesn't (entity E read from sqlserver can be written in oracle without a problem).

Selfservicing is very hard to do in DLinq. They provide lazy loading but it's done in a lame way, like they also did in objectspaces: you don' thave control over it. See DLinq as an example what you can do with Linq. Not as an O/R mapper, because it lacks a lot of functionality to be really useful in real-life applications.

I will really appreciate if you can clear this up for me. I know you must be pretty tired of answering question about linq.

No I'm not tired about that simple_smile Linq is cool. DLinq isn't, so I'm more tired about the fuss about DLinq and about the whole 'look what we made! it's great! an OO view of your database with typed queries!!11'-attitude, I mean, if I can cook it all up on my own, and it's not even my invention (some things I'm pretty proud of but I'm sure someone else already cooked them up decades ago), why would they be so proud about a half-baked system which is in development for over 2 years (!). Two years! LLBLGen Pro is 2 years old (first released on september 8th, 2003), to give it perspective simple_smile

Frans Bouma | Lead developer LLBLGen Pro
wayne avatar
wayne
User
Posts: 611
Joined: 07-Apr-2004
# Posted on: 23-Sep-2005 14:38:52   

Thanks from for your repley.

Linq is a system which offers you to write new method types which can be used to create new resultsets from other sets. It doesn't do anything by itself, the system calls into the methods which do the filtering

OK - So you will have to implement some interface and write method that LINQ calls to retreive data - correct?

First, we will provide a set of “standard query operators” that will make the interface IEnumerable(Of T) , the fundamental collection interface on the .NET platforms, queryable.

So .Net will have native query ability on ICollections in any case?

I am very excite about what i saw on the Video - I love the way you you will be able to search for items!! I will no longer have to write special routines that searches through arrays of objects to return some type of subset.

All i will have to do is write something like.

from objectCollection where objectCollection.item.property = X select object.name

Well that is how i understood it any case when he demo'd that you can search the string class for method with certain criteria.

What version of C# shippes with .Net 2003 and 2005? When will we have this LINQ ability? They were talking about C# 3.0 but when is that shipping?

pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 23-Sep-2005 17:40:49   

Otis wrote:

Trust me, the stuff in Linq will not fully run on .NET 2.0. Some of it will, but for example lambda features aren't available in .NET 2.0, as well as many other things which makes the platform great.

I really don't understand what Paul Vick means with 'it works on .NET 2.0'. I mean, can you create a thing like s => s < 5 ? and pass that to a Where construct? Or use 'var' ?

I think what he means is that it works on the 2.0 CLR. All the extensions are API's framework (New namespaces) and Compiler items (Extension Methods, Lamda Expressions, Type Inference).

If you have those installed then you can run this with the .Net 2.0 beta.

BOb

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 23-Sep-2005 18:31:54   

Though requires a new compiler. So I think they compile IL which runs in .NET 2.0, but requires the 3.0 compiler

Frans Bouma | Lead developer LLBLGen Pro
pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 23-Sep-2005 19:44:23   

Otis wrote:

...but requires the 3.0 compiler

Yep.

I am hopping for a 2006 release of 3.0. Based on the fact they have been working on this stuff for 2 years.

Bottom line is, you can't start using it today. History shows what you see at the PDC may release possible 2-3 years from then.

BOb

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 23-Sep-2005 20:39:13   

pilotboba wrote:

Otis wrote:

...but requires the 3.0 compiler

I am hopping for a 2006 release of 3.0. Based on the fact they have been working on this stuff for 2 years.

I really am at a loss when they even want to release it themselves. 'Orcas' is a big undertaking, it is the 'next' version of the IDE, so I'm not sure 2006 will be possible (not likely).

Bottom line is, you can't start using it today. History shows what you see at the PDC may release possible 2-3 years from then.

true, though at the same time, it runs a high risk of never see the light of day. wink . REmember Microsoft Business Framework from last year ? To me that was the most brilliant designed framework they could ever come up with.

A year later. Nothing at all. Zip. Truly sad.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 20
Joined: 06-Sep-2005
# Posted on: 23-Sep-2005 20:54:55   

Well said Otis.

It's always important to note that a hardware or software company is only really in a hurry with the products they make money from. Dev Stuido is not a money maker for MS, so there is really no profit motive to get this stuff to market. I mean, no decision makers in Global IT Corps are going to decrease purchases of Windows licenses (server or client), because the dev tools don't comply with standards or the tools are lower tech than another platform.

You can bet that all this hoopla is just to get a little developer cheerleading to take place. They've already done a pretty nice job with the VS.Net studio and the underlying CLR and .Net framework, but this stuff seems like the class of method oriented tools MS sees little value in. It contributes nothing to the sale of products that make them money. So, I would have to agree with all the other posts that warn the reader to not re-design your apps around this stuff already as it's likely to be half-baked whne it is released in a usable form three to five years from now.

Posts: 20
Joined: 06-Sep-2005
# Posted on: 30-Sep-2005 17:04:45   

The MS architecture page also recommends not waiting for this - to show how confident they are in the technology:

http://www.msdn.microsoft.com/architecture/

See the left-hand column mid-way down the page and follow the link. The point is that this concept made it to the official MS architecture site.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39612
Joined: 17-Aug-2003
# Posted on: 03-Oct-2005 12:30:45   

Doug_Hettinger wrote:

The MS architecture page also recommends not waiting for this - to show how confident they are in the technology:

http://www.msdn.microsoft.com/architecture/

See the left-hand column mid-way down the page and follow the link. The point is that this concept made it to the official MS architecture site.

The whole Linq stuff is pushed like crazy now, so be sure it will be there, at some point wink . Though the DLinq stuff is in its very early stages, so a lot is just not designed yet. Also, don't expect it anytime soon (I think that's why they said: don't wait for it).

the summit NDA stops me from babbling any further on this, sadly enough, but I'm not worried a single second, so that might give you a clue or two about this subject and what I can't say wink

Linq is cool though. It will make data queryable outside the db as if it's inside the db. This is for me the main gain. Because Linq uses a very extensible way of producing its magic, I can easily add an LLBLGen Pro implementation which consumes expression trees and what not and it's usable with linq instantly, AND you then can also search inside the entity collections returned, mix it with xml using xlinq etc.

But as they're far off from anything solid, waiting for this is like waiting till 6ghz pentium chips are mainstream before buying a pc wink

Frans Bouma | Lead developer LLBLGen Pro