hibernate - will - what should i know before learning spring

What should I learn first, Spring or Hibernate? (10)

First I learned Hibernate. Used groovy to try out different Hibernate examples. Then learned Spring and its Hibernate support. I think I had a really interesting journey.

Here is an example of Struts+Spring+Hibernate application. Struts for front-end, Spring for middle layer and JPA/Hibernate for persistence layer.


I've just started learning Struts and I'm trying to be marketable for a good job as a Java programmer. My next decision would be choosing which to learn next, Spring or Hibernate?

Also do you guys have any suggestions or tips for me to be good? Thanks in advance!

I learned Hibernate by itself first, and then I learned how Spring makes it much easier.

I think you learn Spring, basics of RDBMS and then go for Hibernate, which will be easy for you to learn..

I think you should share your profile in a brief to get a better answer

However... Both hibernate and spring are hot and you will find them in all job requirements posted for enterprise applications- so you are on the right track as far as your selection choices is concerned.

IMHO- hibernate is trickier than Spring The reason for that is- Spring by virtue of its architecture is least invasive to the code There is little API to master. So to code in Spring- you don't have to really code anything beyond Java But to code hibernate- you need to know the Hibernate APIs and the gotchas of hibernate programming. The basics of hibernate are easy to master- but to learn the tricks and trivias- it takes time

If I was the hiring manager and were using hibnernate and Spring I would rather take someone who was stronger on Hibernate rather than someone who was stronger on Spring As far as spring is concerned- you as a contributing programmer- will have little to worry about Most likely the application will already have a framework in place- and you will have to plug in your contributions in.

But to code in hibernate- like I said before- its better if you have soem experience on this

PS: I know everyone has a different viewpoint on this- so you maybe getting more confused .I think- once you share a bit of your profile- it will help people give you a better advice. Good luck !!!

I would go with Spring first. Spring has so many different pieces that are useful: dependency injection, aspect-oriented programming, JDBC helper classes, an entire MVC framework and loads more. You can use as little or as much of Spring as you want on your first application and the reference documentation is truly excellent. You can easily learn Spring without buying even a single book on it.

I wouldn't go for Struts these days.. If you're already considering Spring you should also take a look at Spring MVC, especially the newer Annotation-based Controllers are really nice to work with.

I would suggest learning Spring before Hibernate because it is much easier to learn if you stick to the core and maybe WebMVC, which is what I would recommend. Spring grew quite a bit in the last releases but the core is still simple and easy to understand.

Hibernate is a lot more complicated. I would recommending understanding the general purpose of an ORM like Hibernate, learn the hibernate annotations way of configuring hibernate and then go straight for the Spring/Hibernate Integration because it makes many things much easier. If your domain has more than just a few base types, you could also take a look at the GenericDAO pattern

If the objective it to learn MVC framework and how to use ORM with that framework, then logical way to learn is Spring and then Hibernate. In my opinion, in that way you will be able to grasp the concepts easily

Spring and Hibernate are 2 very complimentary technologies and depending on the needs you may use both, either or none. But the fundamentals both of these frameworks rely upon are 100% marketable and more importantly are required for any seasoned professional.

There is little value in learning Hibernate without first obtaining fundamental knowledge on relational data modeling, relational database design, and transaction processing. So these should be your pre-requisites for Hibernate.

There is little value in learning Spring without first obtaining fundamental knowledge on design patterns, dependency injection, and application design (as general as it sounds you need to understand things like application tiers, class and package dependencies, MVC (sounds like you are familiar with this one via Struts), security and web standards, and of course fundamentals of OOD).

By learning both you will become if not marketable but at least very solid professional who is confident and comfortable in working on majority of Java (and not just Java) applications.

if you need both technologies Spring Live all you need. I've started learning that technologies from completely zero :)

the same here, I learned hibernate first and than Spring, i think it is the right order, do some small examples from youtube, see how you configure hibernate, create a session and do some tricks with your database, at least basic stuff. then go and see how to configure spring with hibernate.