myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Ray" <julianj...@yahoo.com>
Subject RE: Combine Hibernate and JSF, but how?
Date Thu, 12 Oct 2006 13:21:43 GMT
Hi Matthias
 
Here is what our class heirarchy looks like. I'm still in the process of
documenting and refactoring it but you should be able to get the general
idea. We use the threadlocal pattern for managing Hibernate sessions and
transactions. All this detail is provided in the AbstractUIBean which
provides all services for managing page state, materializing Hibernate
objects and managing transactions, getting session beans etc. The Page and
Table abstract classes provide utility methods for manaign individual
instances or lists of Hibernate objects.  We also have a class of
hibernate-aware converters which know how to convert primary and foreign
-key values of objects into correct domain values for the view. 
 
Hibernate itself is initialized via a filter and preloads as many objects
into the second level cache as is useful on app start.
 

 
An implementation with respect to a single class of business objects looks
like this. Each interface (Deletable, Searchable etc.) uses a JSF fragment
which is included into the JSF page. Our JSF pages are heaviy templated with
lots of includes for all common groups of attributes of our business
objects.
 
 

 

 
  _____  

From: Mosimann Matthias [mailto:Matthias.Mosimann@manor.ch] 
Sent: Thursday, October 12, 2006 8:30 AM
To: MyFaces Discussion
Subject: AW: Combine Hibernate and JSF, but how?


Hi Julian
 
 
Well in the presentation layer you have the jsp's and the backing beans. In
the domain layer you have hibernate resp. the persitence classes. And
between them you have this shale-like framework. Do I understand that right?
 
regards
Matthias

  _____  

Von: Julian Ray [mailto:julianjray@yahoo.com] 
Gesendet: Donnerstag, 12. Oktober 2006 14:24
An: 'MyFaces Discussion'
Betreff: RE: Combine Hibernate and JSF, but how?


We use Hibernate and JSF but don't use Spring. We use a Shale-like framework
where each JSF view has a single backing bean which is
Hibernate-session-aware.  Works great.

  _____  

From: Mosimann Matthias [mailto:Matthias.Mosimann@manor.ch] 
Sent: Thursday, October 12, 2006 8:14 AM
To: MyFaces Discussion
Subject: Combine Hibernate and JSF, but how?


Hi everyone
 
 
I'm wonder if it is neccesary to use Spring Framework to combine Hibernate
and JSF. What is you experience in that topic? I can imagine that many
people use Hibernate as o/r mapper. Where can I finde some resources
(articles or books) for a strategy or overview howto combine plain Hibernate
with plain JSF for a three layer architecture. I know theoretically it is
possibly to write some business logic in den managed beans from JSF. This is
the form centric approach Kito Mann discripes in his book JSF in Action. But
that isn't what I want. I'm a beginner in both topics (hibernate and jsf)
and for me it's no clear how this fit together. Is it recommended to use
Spring to stick this two worlds togehter? Is that a good way to use Spring?
 
Many thanks, I'm a little bit confused.
 
regards
Matthias

Mime
View raw message