2

I have learned about database design, including normalization during my undergraduate course. When we have to model a database for a system, we can start with an ER model and then convert it to the relational model and then we could normalize the design, to come up with the final schema of the database.

This was the approach I was thought at college. Now with the adoption of different ORM tools like hibernate, the object classes are directly mapped into tables with annotations(in java).

Does it mean that if we are using an ORM tool we do not need to design our database like before? Does it mean that we do not even have to come up with an ER-Model for our database? It turns out that if we have our object model(in a class diagram), by deciding what objects should be stored, we could automatically arrive at a database design. If so what happens to the normalization? What happens for the tables we would have designed for different relationships(1 to many, many to many etc;) in ER model?

Does it mean that we have traded good database design for ease of programmability?

Thinking about this makes me confused. please explain.

  • 3
    For some projects with some ORMs, you can forget about the database and only think about the ORM and get away with it, and for other projects you can't. Just like when programming in 'high-level' languages, being mindful of the whole process top to bottom, from classes to bits and bytes, is what you need to do. – whatsisname Mar 25 '15 at 16:25
6

Does it mean that if we are using an ORM tool we do not need to design our database like before?

You still need a design; it just takes a somewhat different form. The nature of the design shouldn't change all that much; you're still going to have records and relations, they'll just look a bit different.

Does it mean that we do not even have to come up with an ER-Model for our database?

The entity-relationship model is implied in the class design.

What happens to the normalization?

Same as before. You still store each bit of domain information in one place.

What happens for the tables we would have designed for different relationships (1 to many, many to many etc;) in ER model?

They become collections in the object model.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.