tags:

views:

713

answers:

7

I have looked at NHibernate and EntitySpaces and they both seem to work differently.

In EntitySpaces, you define the database tables and table relationships and the classes are generated for you.

In NHibernate, you define the classes and the table relationships are generated for you. This is what I am looking for.

Are there any other ASP.NET ORMs that generate tables from classes like NHibernate? Any recommendations?

+2  A: 

Linq to SQL can create the database table structures and relationships from the classes, with the dataContext.CreateDatabase() method.

CMS
A: 

This is something that NHibernate does.

And on the subject (that Draemon) started. My personal view is that unless performance is your absolute 1st priority and all other things must suffer to make that happen (e.g. when writing software for a manufacturing fab), you will be better off working on the domain model first.

My reasoning: you spend a lot more time coding against the domain than you do against the database itself -- especially when using an orm. So spend that time wisely.

Chris Brandsma
A: 

I had fairly good success working with Genome ORM. It does many jobs for you. You can first design your domain model and then generate the DB scripts out of that. Beside this Genome generates DTOs for you. It is pretty good at that and saves a lot of time of developers.

http://www.genom-e.com

Pradeep
+1  A: 

I prefer an approach that I have full control to generate what I need as well. In the case of ORMs I get classes that match my tables. I believe that using my own domain of objects that derives from my business and not the underlying data store is the right way to go. My class hierarchies that represent my business data should be 100% independent from the data store.

Neo Christo
+1  A: 

LightSpeed has a really good Visual Studio designer that supports both generating .NET entity classes from the database and updating the database from your .NET entities.

James Newton-King
+2  A: 

Mindscape LightSpeed offers this ability - part of complete scheme round-tripping.

Hope this helps

http://www.mindscape.co.nz/blog/index.php/2008/06/17/schema-round-tripping-in-the-lightspeed-designer/

traskjd
Yes, but Lightspeed doesn't offer a very open choice of design... Composite keys are hardly/poorly supported, and per Mindscapes own web-site "We don't expect primary keys to have any business value".Mmmm. Great. Until it isn't.
Mark
+3  A: 

DataObjects.Net also uses "Code first" (Model first) approach. See http://wiki.dataobjects.net/index.php?title=Features

Dmitri Maximov