Not to sound like a broken record, but I think Spring does a nice job of handling Hibernate. It provides a Hibernate template to handle the Hibernate plumbing and nice support for configuring a SessionFactory. Should be very easy to hook this into WW2's IoC.
Rob ----- Original Message ----- From: "Matthew E. Porter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 07, 2003 8:38 PM Subject: [OS-webwork] Is This a Bad Use of IoC? > I think I may be going Inversion of Control mad lately and need some > help sorting out if what I am doing is just wrong. I am building a new > persistence manager where the core manager is based upon hibernate. > The hibernate manager needs three different providers- one for > Configuration, one for SessionFactory, and one for Sessions. Each of > these providers (Conf, SF, and Session) can have different > implementations. For example, the default Session provider always > returns a new session; however, there is also a ThreadLocal version > which returns the same session for the entire thread. > > The question I have is how do I specify and load these at runtime? The > most obvious answer is to have a custom xml file that specifies which > provider fulfills each role. I could write (and already have done so) > a loader to read an XML file and configure the system. But, instead of > having this in a separate file, would it be a complete bastardization > of the intention of IoC (XWork edition) to use it to automatically > configure the providers? > > Why does this seem bad? Because the primary intention of IoC is to > wire business components whereas these providers will probably never be > used outside the real component, the persistence manager. Instead, it > seems like I am too lazy to write a loader to configure the system. > > > Cheers, > matthew > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork