-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Newbie "Bottom-up" development? How best to proce
PostPosted: Sun Apr 22, 2007 7:42 pm 
Newbie

Joined: Wed Mar 21, 2007 2:07 pm
Posts: 9
Location: Minnesota
I'm trying to use Hibernate (for first time) on a new project. Our application will be implemented as distributed Java SE 5.0 components with an Oracle 9i database. We may move the data management components into a container at some point in the future (but for now I plan to use thread local context management). The database and the application components are being developed at the same time.

It has been suggested to me that I develop the schema first and then generate the persistent entity beans (using hibernate tools). It is believed that the resulting database will be used by other systems so it needs to be well formed (this is why I'm not currently following a Top down scenario).

It appears that the hibernate-reverse-engineering cutomization file does not support many of the O/R metadata options. I need to: (1) map class inheritance (using multiple inheritance strategies), (2) specify eager loading on certain associations, (3) use formula tags, and (4) do other fancy stuff.

My question(s):
(1) Am I completely off base using a "Bottom-up" development process? I've considered using "Middle-out" but that is supposed to only be attempted by seasoned Hibernate experts.

(2) How can I best leverage an existing database schema (that will change as development progresses) to generate mapping information while still having the ability to use finer grained mapping options? Is there a way to combine multiple mapping files for the table/class (one generated and one done by hand)?

(3) Should I just forget about reverse engineering from the JDBC connection?

(4) How would you proceed if you were me (a newbie)?

Any suggestions are appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 22, 2007 8:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I tend to start with the domain object level and move from there. I would suggest you do the same - newbie or not. Even when I work at this level I do keep in mind the resulting schema.

For smaller applications or quickies I will consider the reveng approach from the database schema. This is also reasonable starting point if your dealing with an existing (legacy) database. In general I suggest you just try the various approaches for yourself and see what works best for you.


Top
 Profile  
 
 Post subject: Re: Newbie "Bottom-up" development? How best to p
PostPosted: Mon Apr 23, 2007 4:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
greta wrote:
It has been suggested to me that I develop the schema first and then generate the persistent entity beans (using hibernate tools). It is believed that the resulting database will be used by other systems so it needs to be well formed (this is why I'm not currently following a Top down scenario).


Ok.

Quote:
It appears that the hibernate-reverse-engineering cutomization file does not support many of the O/R metadata options. I need to: (1) map class inheritance (using multiple inheritance strategies), (2) specify eager loading on certain associations, (3) use formula tags, and (4) do other fancy stuff.


Sounds like you should use mapping files or annotations since you are going to do a lot of things that is not easily nor intended to be in reveng.xml. Reverse engineering is primarily to get a good first cut of how a mapping should look like; not as a *final* version of the mapping.

Quote:
My question(s):
(1) Am I completely off base using a "Bottom-up" development process? I've considered using "Middle-out" but that is supposed to only be attempted by seasoned Hibernate experts.


But still you are talking about using features that is not trivial. (1-4 from before).

Quote:
(2) How can I best leverage an existing database schema (that will change as development progresses) to generate mapping information while still having the ability to use finer grained mapping options? Is there a way to combine multiple mapping files for the table/class (one generated and one done by hand)?


no. you will need to integrate the db changes into your mappings over time. That will also give you the best control.

Quote:
(3) Should I just forget about reverse engineering from the JDBC connection?


use it for getting a first cut; not for fully driving your dev especially not when you consider your self a newbie. You should learn what the mappings does; not just generate the blindly with a tool.

Quote:
(4) How would you proceed if you were me (a newbie)?


I would use mapping files or annotated classes if you want so fine grain control over it (which makes alot a sense)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 7:36 am 
Senior
Senior

Joined: Sat Apr 21, 2007 11:01 pm
Posts: 144
Hi greta, I'm a newbie too and I've recently started my own project. I use Hibernate at work in a big production system and I've borrowed a few core concepts from their design that I really like.
We use bottom-up and it works very well. All tables are mapped in hibernate and Domain Objects and the DAO layer are all regenerated after any schema change using reverse engernearing.
See topic here: http://forum.hibernate.org/viewtopic.php?t=973797
And here: http://forum.hibernate.org/viewtopic.php?t=973830

_________________
Everytime you get an answer to your question without giving credit; god kills a kitten. :(


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 9:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I am glad bottom-up working well for you. It is good to see we have enough flexibility that people can use this as a standard development approach. Having said that I tend to use reveng as a starting point then work from the domain/mapping layer. The good thing about the tools is that we offer a number of approaches which suite different people's styles and project sizes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.