views:

112

answers:

2

I am just starting to model the data for a new project, which must be persistable.

Looks like the most natural OO model will have lots of nested .Net generics. Lists of objects, and these objects will also contain Lists of other generic types, and so on, nested at least three levels deep.

Ideally, I'd like to just design the data model in an OO fashion, and am hoping that there is an ORM that will allow me to just (magically ;-) persist the whole model to a relational database without me having to worry about the relational schema at all.

I'm willing to sacrifice performance for ease of initial implementation, but a solution that allows optimization of identified bottlenecks would be nice too.

Are there any ORM options that work this way?

Or maybe I should just serialize the data...Google's Protocol Buffers looks like an interesting option.

+2  A: 

Given that you don't want to worry about the "relational schema at all", I'd recommend Subsonic or Lightspeed.

They work slightly differently, but both make this very, very easy to implement for .NET.

Reed Copsey
@reed - Thanks for the sugestions. I had already looked at Lightspeed, but it looks like they still are very DB centric - http://www.mindscape.co.nz/blog/index.php/2008/06/17/schema-round-tripping-in-the-lightspeed-designer/ has many references to foreign keys, etc. I'm hoping to find something that will take an arbitrary C# complex object, and create a schema from that.
Tom Bushell
Lightspeed is pretty good at doing that. Subsonic's easier, though.
Reed Copsey
Subsonic does, btw, handle nested lists -> separate table mapping automatically. It's pretty slick.
Reed Copsey
+1  A: 

I would also suggest Subsonic using the SimpleRepository template.

aanund
@aanund - Thanks for the link. Subsonic seems to have the object-centric approach I'm looking for, but the example they show only uses simple types. Do you know if Subsonic can automatically persist generic types such as List<>?
Tom Bushell