On this page.... RSS 2.0 | Atom 1.0 | CDF
# Friday, September 16, 2005

I just finished watching the interview with Anders on Channel 9 about LINQ.  This is one of those things that your grandchildren will ask you about--where were you when you first learned about LINQ? 

Obviously, I'm using hyperbole, but I really do think that this is a huge step in the right direction.  I tried to implement something similar (and I say that loosely) with my DataAspects ORM query syntax.  My problem is that I was limiting myself to C# v1.1, so, for instance, I used an instance of the object to be queried as the source for the criteria of the query when getting a collection. 

For instance:

Order criteria = new Order();
criteria.Customer = myCustomer;
OrderCollection oc = new OrderCollection();
DataAspects.DataProcessor.FillCollection(oc, criteria, "GetOrdersByCustomer");

Suprisingly, this worked for a lot of simple cases, but it broke down for any kind of complex criteria so that you had to resort to ADO.NET and passing a data reader into the object collection builder.  But the key for me--the thing I wanted to achieve was to be able to build my query using all the nice features of VC# like type checking and statement completion.

Well, LINQ does that and a whole lot more.  The thing is that they, thankfully, were not limited by C# 1.1 but were able to invent C# 3.0 and .NET FX 2.0.  So they get to invent new keywords, syntax, etc.  Yeah yeah, I know.. the world's smallest fiddle...  But really, I'm just glad that it's here and that I don't have to worry about solving that problem. :)

One thing, though, is that they are going to go the route of attributes on classes to do the mapping (or so it sounded like), which I like (that's how I was doing DataAspects).  We'll see how that pans out.  Of course, they also will have the nice GUI-generated object layer for your database, which is one step above the typed DataSet.  It still doesn't recommend OOD as a application design philosophy, but at least, via mapping, we'll still be able to take advantage of these features that really are plumbing that we shouldn't have to deal with. 

I know there are different strokes for different folks, and there are plenty (probably most MS developers) of devs who like to start with the database for their application design (ugh!).  My own preference is to start with the problem domain and OOD and then worry about persistence later.  I've got an article submitted to CoDe on this topic, but if they don't want to publish it, I'll probably put it up on ASPAlliance or somewhere else.  In any case, LINQ will make OOP much, much easier and provide even stronger practical arguments for using OOD, and for that, I'm very thankful and eagerly looking forward to digging into it myself.

So if you haven't already, go check it out!

Friday, September 16, 2005 5:47:59 PM (Eastern Daylight Time, UTC-04:00)  #    Disclaimer  |  Comments [0]  |  Tracked by:
"Spang - Wha's That All About??" (+dotNetTemplar+) [Trackback]

Comments are closed.

The opinions expressed herein are solely my own personal opinions, founded or unfounded, rational or not, and you can quote me on that.

Thanks to the good folks at dasBlog!

Copyright © 2019 J. Ambrose Little