Sunday, January 09, 2005 - Posts

Something I'd like to see in the CLR...

At least I think that's where it would belong:

One of the features I liked about ObjectSpaces <sob> was the OPath query language...I especially found the XPath-like syntax very elegant and powerful.I believe something object-oriented languages and frameworks could really do with is the ability to obtain subsets of collections and arrays of objects based on the values of properties.
So if I have an array of Person objects called people (and they're always Person objects, aren't they?...either that or Customer, or God help us, Employee...) I want to be able to do something like the following:
Person [] coolPeople = people[][”GivenName='Kevin'“];
Or even better;
Person [] coolPeople = people[][.GivenName=“Kevin“];(Although that's possibly too VB-ish)
I know that right now I can do something similar with DataSets, and to make it slightly less gross, typed DataSets, but that limits me to the relational DataSet model (and database-obsessed objects lacking in behaviour, unless I jump through hoops), and I want it with POCO (Plain Old CLR Objects).

And I'm not going to eat my greens until I get it...