0

When developing with MVC with an ORM I dont like the idea that the ORM will make changes in my DB. My application is a data driven application and the DB is the the first thing i created. Isn't that an overhead to maintain the data scheme both in the model and in the DB? How do i manage it? Any ORM that is more suitable to this kind of work method?

2 Answers 2

1

I dont like the idea that the ORM will make changes in my DB

ORM don't have to make any changes in your database structure. If you have existing database you can simply use it without requiring any automated changes.

Isn't that an overhead to maintain the data scheme both in the model and in the DB?

How do you want to present your data in MVC? Are you going to use classes representing your data from the database? If yes then you have a reason why ORM exists. ORM maps relational data from database to classes = it loads them for you and persists them for you (= you don't have to deal with database access and SQL). If you are going to use object oriented strongly typed approach then ORM will not be overhead for you.

If you are not going to use such approach you don't have to use MVC. Just use ASP.NET with SQL data sources or ASP.NET dynamic data.

Any ORM that is more suitable to this kind of work method?

You have no special method.

Almost every ORM has some support tools or extensions which allows you creating basic mapping and sometimes also classes from existing database. In EF you will simply add Entity Data model to your project and in wizard selects tables you want in your application.

Sure the last paragraph was simplified. Each ORM has learning curve and its specialties so it will not be so "simple".

Sign up to request clarification or add additional context in comments.

1 Comment

which one do you recommend? i thought of using ActiveRecord
0

For .NET 4 Entity Framework, the tooling let's you go both directions; generate a database from a model and generate a model from a database. These features give you flexibility when implementing your change management protocols. I'm not sure what options are available for NHibernate.

Entity Framework references:

http://msdn.microsoft.com/en-us/library/bb386876.aspx

http://msdn.microsoft.com/en-us/library/bb399249.aspx

http://www.simple-talk.com/dotnet/.net-framework/entity-framework-4460---learn-to-create-databases-from-the-model/

A Stackoverflow comparison of the two:

Deciding between NHibernate vs Entity Framework?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.