Re: [picocontainer-dev] The constant web design wall I keep hitting [long]

Konstantin Priblouda <kpriblouda-/[email protected]> Mon, 30 Jun 2008 13:04:09 -0700 (PDT)
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>

----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/


--- On Fri, 6/27/08, Mauro Talevi <[email protected]> wrote:

> IMO this is the key aristotelic syllogism:  it depends on
> hibernate 
> therefore it must reside in (webapp) request scope.

Indeed, there is a problem arising from idea  that no container component
shall even know a scope below does exist. 

> Why do you assume this?  You can happily have a
> persister/dao living in 
> application scope and it will fire off different hibernate
> requests.

Well, the problem is, where does dao gets his session? 
Need to manage it in dao invalidates whole idea of DI

OK, I can think about some component that
 - pretends to be a session
 - lives in app scope
 - transparently delegates to (hot swappable)
real session managed in request scope

Another tricky issue are hibernate entities. They are definitely of 
litte use outside  their own session (ok, they can be detached, but 
then you slurp in whole object tree, and hibernate folks produce 
subtle changes in behaviour even on minor releases) 

regards,


      

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email