Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Hibernate
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 22nd, 2005, 12:56 AM
Registered User
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database First,Object First?

When we design a MIS Application,which is right?
1.Design the database table first,then design the data object
2.Design the data object according to business logic,then use some O/R Mapping tools to generate the databse table
3.design the databse table and data object in the same time

Old November 11th, 2005, 12:22 AM
Registered User
Join Date: Oct 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

I'm not MIS, more back-end web dev and this is just personal experience, but:
data object first. If your a back-end guy you want your code working in a simple form, then want to build it out.
front end can request change of database, you just want your code working as the first step before you waste a heap of time therefore you "stub out" your code (including the dataobject) then flesh it out, make the database, complete everything. It's a personal opinion, but there you go.

Old September 19th, 2007, 09:37 AM
ski ski is offline
Registered User
Join Date: Sep 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

In my opinion, Hibernate should be used where the database is normalized
 and proper indexing is in place, so as to use really interesting
functions of Hibernate.



Old September 30th, 2007, 01:41 AM
Registered User
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rainwly0819 Send a message via Yahoo to rainwly0819

There are three model to develop a Hibernate application listed by "Hibernate in Action":
[1] Top down
?) Start with an existing business logic, its implementation in Java.
?) Create mapping metadata (in xml files, etc.)
?) We can let Hibernate's "hbm2ddl" to generate the db schema.

[2] Bottom up
?) begin with an existing db schema and data model.
?) Use the reverse_engineering tools to generate XML mapping files.
with "hbm2hbmxml" for example. With "hbm2java", a skeleton fro a Java persistence layer is generated.
?) Expected some manually work.

[3] Middle out -- recommend only for seasoned Hibernate expert
?) Begin with handwritten Hibernate XML mapping files.
?) Then generate the db schema with "hbm2ddl" and Java classes with "hbm2java". The Hibernate XML mapping files are constantly updated during the development, and other artifacts are generated from this master definition.

[4] Meet in the middle -- the most difficult scenario
?) Combining existing Java classes and existing db schema.

A beginner to hibernate, hope can help a bit.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database or object is read-only ryanb Access ASP 25 January 17th, 2014 06:36 PM
Accessing Object of Database Sheraz Khan ASP.NET 2.0 Professional 0 August 27th, 2007 10:30 PM
Database First,Object First? yinzhg J2EE 0 October 26th, 2005 01:28 AM
Can't DIM database object egolsen Access VBA 2 September 26th, 2005 04:25 PM
Database Connection Object mrideout BOOK: Beginning ASP.NET 1.0 4 August 3rd, 2004 07:42 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.