Linq for ActiveRecord
castle, opensource, programming, tech April 10th, 2008Another topic which is near and dear to my heart is database access technology. Linq for SQL for example is very interesting, almost too interesting. :) One of the problems is that it can be used as an argument against using the ActiveRecord or NHibernate libraries you may already be taking advantage of in your Castle Project based solutions.
So I was delighted to see some posts relating to this topic from Ayende Rahien and Ken Egozi. Based on their excellent work it was simple to construct a Castle.ActiveRecord.Linq library which allowed you to build Linq expressions against a set of ActiveRecord classes as easily as you can build them against a set of Sql DataContext classes.
And all due respect to Microsoft, the designer of their data context still leaves a little to be desired as far as reducing the effort it takes to make tables based on fairly standard assumptions. Yes, it is graphical, but in a basic primary-key one-to-many relationship I was still left manually adding and configuring all of the properties of the columns. And still manually selecting which columns are involved on either side of the relationship.
They’re making great strides but the convention-over-configuration philosophy needs to sink in a little deeper.
And I do agree with Ayende’s when he said, “Of course, I still think that who ever designed Linq was mad.” One of the things that bothers me the most is how it could lead you down a path that returns to the days where you had raw SQL statements distributed throughout your software.
But it is cool.
Recent Comments