We can't use Spring in our current project. I won't go into why. But we are using
JSF so I figured I could use JSF's managed bean facility to do what I normally use Spring for and that is to inject DAO's into Service classes and access those service classes within the application.
Actually, let me back up. First, I created my own ServletContextListener that read my own really simple XML file and did the same thing. I threw all the services in application scope. But as I was configuring my backing beans for the JSF pages, I realized I could probably do the exact same thing I was doing with my own listener using the managed bean facility.
So what I do is declare a bean for my DAO and then declare a bean for my Service and inject that dao into the service using the managed-property (sound familiar?). Because there are parts of the application that doesn't use JSF but still needs access to the services, I have to place both the dao bean and the service bean in session scope.
My question is, does anyone see a downside to this? Any gotchas?
[ June 16, 2006: Message edited by: Henry Lowell ]