Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

About the JSF,Hibernate and Spring??

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, all
I am currently working on a project which i thinking of using JSF and Hibernate. JSF for display layer, and Hibernate is just for the persistent layer. Then i tried to find out how to put them work together. However, i found that lots of examples on the Internet is about JSF + Hibernate + Spring. It seems that JSF can not just work with Hibernate. Spring is needed. I know nothing about Spring, so what is Spring? what is this framework do? Why people like to put it to work with JSF and Hibernate? any helps is appreciate!!! thanks~~
author and cow tipper
Posts: 5006
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any thoughts that JSF or Hibernate need Spring is just pure nonsense.

JSF is your front end. Hibernate manages persistence. The two can talk directly to each other, or you can layer your application.

Spring can sit in the middle and help out the conversation, but it certainly doesn't need to. I've worked on many Hibernate and JSF projects. Only a small percentage used Spring.

Use the right tools for the job. Don't get into 'framework bloat' just because everyone else is doing it.

-Cameron McKenzie
Saloon Keeper
Posts: 25473
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring is a framework whose primary purpose is to allow you to construct and wire together JavaBeans. There's a core component, designed to be lightweight, and then there's add-on components for specialized functions such as ORM support (including Hibernate and JPA).

There's no absolute requirement that an app use Spring, but there are some advantages. For one, since the bean instances and relationships managed by Spring can be controlled by an external configuration file, you can make plug-replaceable components and swap test components in and out. I've got a dummy emailer in one app right now. For testing it just dumps the generated emails to the log. In production, I'll wire in the production mailer and it can begin actually transmitting mail.

One of the best reasons for using Spring with an ORM - or even raw JDBC is that its persistence component takes care of a lot of grunt work. There are certain things that you have to do over and over again when dealing with persistent store, and I've seen a lot of sloppy code on that account - especially leaky JDBC connections. Spring obviously can't keep people from writing sloppy code, but its persistence wrappers can at least ensure that the sloppy code doesn't leak connections. Additionally, Spring provides abstract transaction management which meets or exceeds things that would either be even more grunt work or require EJBs, and it does so for environments where pre-V3 EJBs weren't supported.
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic