ObjectSpaces Explained

By | | .NET

7

ObjectSpaces

Following the introduction to Whidbey article, this blog will feature some new, more advanced features and technologies in Whidbey.

The first technology to look at, and be prepared for, is ObjectSpaces. ObjectSpaces allow you to map your database tables to actual objects you can create and manipulate in your code. Yes, no more scrappy SQL statements :) But ORMs for .NET aren’t new. There are many implementations out there already, but ObjectSpaces is Microsoft

Written By:

Philip Miseldine

Philip is a Computer Science PhD student at Liverpool John Moores University. He's still not mastered guitar tabs, never finished Mario, and needs a haircut. He discusses life at http://www.miseldine.com/.

Website
>> More Posts By Philip Miseldine

 

{ 7 comments }

David December 12, 2007 at 4:53 am

This is all great and wonderful but, System.Data.ObjectSpaces DLL is nowhere to be found… Does anyone know where I can get it from?..

miseldine March 19, 2004 at 6:47 pm

I hacked the examples from what we had at University…apologies if it is no longer current…one of the perils of previewing pre-release technologies I guess :)

The concepts are still relevant however, but I will get on to updating the code. Thanks for the pointer.

PaulWilson March 19, 2004 at 1:49 pm

You seem to be using a really really old preview version of ObjectSpaces, since the Whidbey preview version is different in many cases from your examples. I recall there was another preview back a few years ago, and there are still a few articles on the net based on it. Check out this article for the current syntax and downloadable sample that will run under Whidbey: http://authors.aspalliance.com/paulwilson/articles/?id=21.

miseldine March 6, 2004 at 8:32 am

You’re absolutely right in many cases dhtmlgod :)

Microsoft’s Whidbey release only supports Microsoft databases, and at present Microsoft have no plans to support other database vendors, though have developed the technology to open it up in the future. Read Andrew Conrad’s unofficial-official position on this.

Microsoft themselves state in their literature for ObjectSpaces, use them if “Raw performance is not your main goal”. That said, overheads of producing your own business object “mappings” will narrow the performance gap too. I’ve used ObjectSpaces in Whidbey, and there is a definite pause when streaming very large data sets with the ObjectReader vs. SqlDataReader…

Microsoft have entered this field rather late in my mind…if they’d had this available when .NET v.1 shipped, it would be something to get excited about. But its all here already, tested, examined, and available. Try Entity Broker, or Paul Wilsons ORMApper which is based on the ObjectSpaces syntax and supports MySQL.

dhtmlgod March 5, 2004 at 6:23 pm

I had a proper look at ObjectSpaces, finally, last night. Very exciting! Makes my geek juices flow!

But there are a couple of things though:

1. Quality of SQL
If the SQL is, basically, crap, then it

Kyle March 5, 2004 at 9:33 am

Cool… First I’ve heard of this technology.

M. Johansson March 4, 2004 at 8:47 am

Nice stuff.

Comments on this entry are closed.