Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

We started (just me and my friend) working on a website. As a part design phase we have finished the drawing a Site Map, decided on the content in each of the web page and the navigation.

As we want to use the Spring MVC and Hibernate we want to start on Classes design (domain classes) first so that the database part is taken care by Hibernate (Except for some tables for static data). Does our approach correct? Is my understanding correct that when we use Hibernate the 80% of the database design can be forgotten?

share|improve this question
2  
The approach you are referring to is called "code-first" in contrast to "model-first". Personally, I don't believe in the code-first approach. I think database design must be performed up-front. I am biased. –  Emmad Kareem Jul 27 '12 at 3:00
    
@EmmadKareem: code-first does not imply ignoring the database design. Sure, it can happen, but you can still keep the resulting database in mind when working code-first. –  Joachim Sauer Jul 27 '12 at 6:47
    
@JoachimSauer, you are correct, thanks for hinting to this. –  Emmad Kareem Jul 27 '12 at 9:33

4 Answers 4

up vote 5 down vote accepted

No, your database is still important

NHibernate is an object-relational mapping (ORM) solution for the projects: it provides a framework for mapping an object-oriented domain model to a traditional relational database. Thus it is important to keep your database in a good shape.

Otherwise, you may face with performance issues once you project starts to grow.

In addition, it is always pays back if you keep your database design as normalized and as good as possible.

References to support my point:

share|improve this answer
2  
There is Hibernate for Java platform, after which NHibernate was copied. –  m3th0dman Jul 27 '12 at 6:05

Your understanding is correct. Your domain model will be the key driver for database schema.

But managing the schema is best done outside of hibernate, though hibernate can create tables for you based on configuration. This way, though you have to manage database schema separately, you will have full control to manage the primary keys, constraint, foreign keys etc. Also, you need not worry about data being wiped every time you re-deploy the application.

share|improve this answer

You can leave it for the moment, but don't, really DON'T forget about it. It is important to keep your database in a good shape, as mentioned by others. Hibernate will create you schema, it might be okay. But have a look at it before you finish work, chances are you will find serious flaws.

Personally I'm with @Emmad Kareem. Database design has to be done up front. You can forget about 80%, your right. But make sure you don't forget about 100%.

share|improve this answer

You can start coding without design (either database design or application design) if you are experienced and if your application is small. On the other hand there aren't applications in which too much time was spent in ; so by doing design you can be pretty sure that your applications is going to be better.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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