Personally, I do *NOT* like to use Spring, because every time I touch it
everything breaks.  I think that a better solution is to use a
ServiceLocator to provide the Hibernate SessionFactory.  I did this in S1,
and it worked very easily, and didn't break anything.  ServiceLocator is
described in the "Core J2EE Patterns" book very nicely (available on-line at
Sun).  In my opinion the rush to IOC and DependencyInjection is more of a
fad/hype than a real benefit.  ServiceLocator is easier, and makes your app
more portable, because you don't have to implement the IOC service before
you can get your code to work in the new framework.

All this, of course, is IMHO, and I know I'm probably a minority here.
- Ray Clough



Rick Schumeyer wrote:
> 
> Now I'm trying to configure Hibernate with S2, which many others have 
> done.  I was trying to follow the example in WebWork in Action, but 
> things have obviously changed since then.
> 
> To be clear, the problem is to create a SessionFactory once in such a 
> way that all my actions can easily have access to it.  The approach in 
> WWiA uses IoC.  As far as I know, it would work in S2 but would need 
> many modifications because package names have changed.  And perhaps 
> other mods would be needed?
> 
> I'm not sure if the best approach is:
> 
> a) Use the strategy in WWiA, but change the import statements to match 
> the current jars (and perhaps make other changes to match S2)
> 
> or
> 
> b) Something else.
> 
> Perhaps someone could point me to a complete solution?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/moving-on-to-Hibernate-with-S2...-tf3729349.html#a10441853
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to