• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Learning Hibernate & Spring

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
I heared a lot about Spring framework and hibernate and I really want to play with them.
but I have some questions :
1. are they an easy to learn technologies ?
2. can I relay on their documentation to learn these technologies.
I don't want to spend some money right now on some books.
3. is hibernate a replacement for JDBC and spring a replacement for EJB ?
thanks.
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In order:
1. as any tech they need some attention from the developer. Hibernate is not putting very much presure on dev and following the quick indications found in the documentation will help you to have it working painless. As for Spring, if you feel comfortable with lightweight container you will make it.

2. Hibernate and Spring have the best documentations I ever seen on open source projects.

3. Hibernate is an ORM (Object/Relational Mapping framework) helping the developer to concentrate on Object world (decoupling the OO from relational world - SQL). Spring is a lightweight container and so in a way could be seen as a replacement of application server (containers).

./pope
 
Ranch Hand
Posts: 1902
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having been playing with Hibernate for a while now (I'm in the progress of rewriting an application to use it), I can say it is very easy to learn. I did, however, pick up a book - Hibernate: A Developer's Notebook - to get a jump-start on it, but from having perused the documentation and forums on the website, they seem to give enough information to get one going quickly.

It really is very easy to learn, so much so that you'll be surprised.
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

1. both, spring and hibernate, are easy to start with. might get more complicated if you get over the "hello world" stuff and try to solve some real world problems with 'em.
2. both projects have good documentation, i would even say that they are among the best docs i've seen for open source / non commercial projects. i know from myself that writing docs is not the fun part so i really appreciate the docs hibernate and spring team created.
(i would not go for the "developers notebook" since it only covers the easy things you can also get from the (excelent) hibernate docs. i dont know about the "hibernate in action" yet (i ordered it on bookpool but they are out of stock) but i guess you get more insights.)
3. hibernate builds upon JDBC. it can be a replacement for your own persistence code if you need to persist Object to a RDBMS (how many times have you written the same stupid try/catch/finally PreparedStatement-ResultSet stuff over and over in your code ?)

cheers

pascal
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by pascal betz:
[...] (how many times have you written the same stupid try/catch/finally PreparedStatement-ResultSet stuff over and over in your code ?)



LOL. You will still need some try/catch/finally in Hibernate2 to manage the Session (to solve the HibernateExceptions ;-)). This is changed only in Hibernate3 where HibernateException is now runtime exception.

./pope
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Spring and Hibernate and i'm pretty happy with both.

The petclinic sample application that comes with spring is a good start
point to see this two great applications together.

Try using facades with BeanNameAutoProxyCreator making spring inject
the transaction interceptors into all *Facades beans.

In many cases I just say bye to SLSBs
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Todd:
Hi all.
I heared a lot about Spring framework and hibernate and I really want to play with them.
but I have some questions :
1. are they an easy to learn technologies ?
thanks.



Both technology is easy to learn Because both tectnology have several tutorial/document on the internet.

Hibernate : http://hibernate.org
Spring Framework : http://springframework.com


Originally posted by John Todd:
Hi all.
I heared a lot about Spring framework and hibernate and I really want to play with them.
but I have some questions :

2. can I relay on their documentation to learn these technologies.
I don't want to spend some money right now on some books.

thanks.


Yes, you can.

But you shoulde be have some book, it better than..

Originally posted by John Todd:
Hi all.
I heared a lot about Spring framework and hibernate and I really want to play with them.
but I have some questions :
3. is hibernate a replacement for JDBC and spring a replacement for EJB ?
thanks.



Hibernate is

Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java. Hibernate lets you develop persistent classes following common Java idiom - including association, inheritance, polymorphism, composition and the Java collections framework. The Hibernate Query Language, designed as a "minimal" object-oriented extension to SQL, provides an elegant bridge between the object and relational worlds. Hibernate also allows you to express queries using native SQL or Java-based Criteria and Example queries. Hibernate is now the most popular object/relational mapping solution for Java.



SpringFramework is

Java/J2EE application framework based on [Expert One-on-One J2EE Design and Development] by Rod Johnson. Includes JavaBeans-based configuration, an AOP framework, declarative transaction management, JDBC and Hibernate support, and a web MVC framework.

 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ali


LOL. You will still need some try/catch/finally in Hibernate2 to manage the Session (to solve the HibernateExceptions ;-)). This is changed only in Hibernate3 where HibernateException is now runtime exception



if you use Springframeworks HibernateTemplate, then you do not have to care for the checked Exceptions. HibernateTemplate (API) only throws DataAccessException (API) (check also all the subclasses) which is a Rutime Exception.

pascal
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by pascal betz:
Ali


if you use Springframeworks HibernateTemplate, then you do not have to care for the checked Exceptions. HibernateTemplate (API) only throws DataAccessException (API) (check also all the subclasses) which is a Rutime Exception.

pascal



10x pascal. I am not currently using Spring - so I left out this piece of info. My mistake.

./pope
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mind if I second the opinions voiced above? My team is an early Spring adopter. We have used both Spring and Hibernate on some chunky projects and are very happy with both of them.
  • are they an easy to learn technologies ? Well, how much do you already know, what parts of Spring do you want to adopt, and are you an easy learner? The transparent persistence of O/R mappers (Hibernate, in this case) can throw you initially if you're just used to JDBC. It will take a bit of time for you to get the hang of producing a good O/R mapping. The Spring framework is actually a multitude of frameworks. It's huge. Fortunately it's all independent, so you can pick the stuff you're interested in and learn it bit by bit. What might take you a bit of time is getting to grips with AOP concepts, but fortunately you can use declarative transaction support without understanding AOP. Similarly, the flexibility of the MVC framework might confuse you: compared to, say, Struts, it can be elusive because it is so much less rigid. It's worth it though.
  • can I relay on their documentation to learn these technologies. I can only echo what has already been said: documentation for both projects is well above average. Do buy a few books, though, certainly if you're working in a commercial setting: they will quickly earn themselves back.
  • is [...] spring a replacement for EJB? It is and it isn't. It does not attempt to replace EJBs in the things they were designed for, specifically distributed systems and MDBs; it complements and enhances EJBs in such cases. However, it does provide an alternative for a couple of common situations where EJBs are a less than perfect fit, for example the business tier in a collocated (single-JVM) system where you might use EJBs simply to give structure to your code and benefit from their declarative transactions. In such situations, Spring does a much better job than EJBs used to do.
  • Do explore the Spring/Hibernate stack; in my opinion & experience, they do live up to the hype for a broad range of problems.

    - Peter
    [ September 03, 2004: Message edited by: Peter den Haan ]
    reply
      Bookmark Topic Watch Topic
    • New Topic