Re: learning Hibernate

[email protected]
Newsgroups gmane.org.user-groups.trijug.juglist
Message-ID <[email protected]>
I have tried Hibernate 2/3.0 and I have used 
JPOX JDO (http://interjavanet.typepad.com/weblog/jdo/index.html)

Originally, I was more inclined to use JDO in the beginning as my
thought was
that Hibernate is a strictly an O/R implementation where as JDO followed
to the JDO Sun specification.  It is my impression that JDO was
being replaced by JPA (Java Persistence Architecture). It seems JDO venors
such as Kodo has made their code base open source and are moving toward the
JPA roadmap. From what I know about EJB 3.0, I have heard is that 
it was written using hibernate.

I would say if you are interested in using Hibernate, the book Hibernate
Quickly
is one I suggest. I liked that one better than the Pro Hibernate book.






For those that don't like Hibernate's learning curve and its 
requirement that you learn SQL and relational databases (which you are not 
supposed to have to learn if you are using an API that really offers 
transparent object persistence), you should consider JDO 2.0. JDO 2.0 is an 
officially approved JCP standard, there are over a dozen JDO vendors out 
there competing for your business (Hibernate has proprietary API from a 
single source), all supporting a binary compatible API.

With JDO you only work with your Java object model, when navigating the 
database, and when expressing queries. Except for starting and 
committing transactions, or issueing a query, your application can strictly 
navigate your object model without using any JDO API at all. In fact most 
of your application logic never needs to import and directly use any 
methods provided in the JDO interface. You can even take existing Java 
object models and application logic and make them supported in JDO 
without even rebuilding them, you don't have to add any code to them.

If you used Hibernate because it was free and open source, then 
consider JPOX at jpox.org, it is free, open source, and was the reference 
implementation for JDO 2.0. It is unfortunate that when JDO 1.0 came out, 
there was no free, open source relational implementation. Because 
Hibernate was free at the time, and no one was willing to spend money on 
software tools at the time, a lot of companies flocked to Hibernate. But 
many also chose to buy a JDO implementation to use, but most went with 
the free Hibernate. Well JPOX is a free JDO implementation supported JDO 
2.0. Just give it a try for a subset of your object model you did in 
Hibernate. Then compare for yourself the difference.

> 
> From: Larry Karnowski <[email protected]>
> Date: 2006/08/15 Tue AM 10:18:05 EDT
> To: Richard Hammer <[email protected]>
> CC: juglist <[email protected]>
> Subject: Re: [Juglist] learning Hibernate
> 
> We're using OJB from Apache instead.   I didn't make this decision, 
but 
> from what I've heard of Hibernate I think it was a good one.  AFAIK 
the 
> big difference between OJB and Hibernate is that there is *no* query 
> language in OJB.  It's all object-based, using the Interpreter 
pattern 
> to build a query.
> 
> OJB is pretty nice because all you have to learn is another XML 
config 
> file and a new API.  Programming nowadays in Java is always about 
> learning a new XML config file and an API, right?
> 
> Another nice thing is that OJB plays nice with an older system.  
We're 
> currently moving our old JDBC factory objects over to OJB.  It's nice 
to 
> be able to write JUnit tests against the factory interface, create a 
new 
> OJB implementation that replaces the JDBC impl, and then use Spring 
to 
> determine which one to use at runtime.  We can ensure that the new 
OJB 
> implementation works the same and performs the same as the JDBC impl 
> with JUnit, and if we have to, we can roll back to the old 
> implementation.  (We had to do that at one point.  Now we're fixing 
the 
> bug and will be able to move back to OJB in the next release.)  (IoC 
ftw!)
> 
> So my caveats -- I'm pretty experienced with SQL, and I'm pretty 
> inexperienced with Hibernate.  I'm not recommending OJB over 
Hibernate. 
>   I'm just saying that we're having good success with OJB.
> 
> Hope this helps,
> Larry
> 
> Richard Hammer wrote:
> > I have assumed that it would be good to learn Hibernate, mostly 
because 
> > I've seen many job ads in which Hibernate was listed among the 
desired 
> > skills.
> > 
> > So I've been working at it.  I've run a few very simple 
applications. 
> > I've read a lot of online documentation and half of the book 
_Hibernate 
> > In Action_.
> > 
> > It is difficult.  Hibernate does not relieve the developer of the 
> > requirement to understand relational databases and SQL.  Rather it 
adds 
> > to what the developer must know.  And it appears to be quite a lot 
to 
> > know.  At this stage I would say that learning Hibernate (after one 
has 
> > learned relational databases and SQL) is more work than learning 
> > relational databases and SQL.
> > 
> > To use Hibernate successfully it seems that one needs to learn to 
think 
> > in the Hibernate way, and you can't do that until you've "grown up" 
in a 
> > Hibernate world.
> > 
> > At this point I am still assuming that Hibernate must be a great 
tool, 
> > because so many employers ask for it.
> > 
> > But I have some doubt because, in a parallel development, for years 
now 
> > many job descriptions have asked for experience with EJB.  But does 
that 
> > prove that EJB is a good technology, or only that lots of people 
have 
> > been caught up in EJB hype?  EJB seems to be losing some if its 
glamor 
> > in what I'm reading recently, and I am given doubt that EJB has 
ever 
> > lived up to its promises.  For all I know the enthusiasm over 
Hibernate 
> > may follow the same pattern.
> > 
> > See, I used the word "pattern".  Now hire me.
> > 
> > But, if all this leads up to a question, are there people who are 
using 
> > Hibernate successfully in real, working, mission-critical, 
applications? 
> >   Probably that is a dumb question.  But still it would encourage 
me to 
> > receive an affirmative answer from respectable people on this list 
whom 
> > I know.
> > 
> > Thank you,
> > Rich Hammer
> > 
> > _______________________________________________
> > Juglist mailing list
> > [email protected]
> > http://trijug.org/mailman/listinfo/juglist_trijug.org
> 
> -- 
> Larry Karnowski
> HickoryWind.org, Keeps Callin' Me Home
> Americana Music News, Reviews, & Personality
> www.hickorywind.org
> 
> 
> _______________________________________________
> Juglist mailing list
> [email protected]
> http://trijug.org/mailman/listinfo/juglist_trijug.org
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.