Petras
Petras

Reputation: 4779

ORMs that generate database structures from classes

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?

Upvotes: 3

Views: 1258

Answers (7)

Dmitry
Dmitry

Reputation: 434

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

Upvotes: 4

traskjd
traskjd

Reputation: 1008

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/

Upvotes: 2

James Newton-King
James Newton-King

Reputation: 49062

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.

Upvotes: 1

Neo Christo
Neo Christo

Reputation: 31

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.

Upvotes: 1

Pradeep
Pradeep

Reputation: 3276

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

Upvotes: 0

Chris Brandsma
Chris Brandsma

Reputation: 11736

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.

Upvotes: 0

Christian C. Salvadó
Christian C. Salvadó

Reputation: 828050

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

Upvotes: 3

Related Questions