Re: [picocontainer-dev] The constant web design wall I keep hitting [long]
Mauro Talevi <[email protected]> Fri, 27 Jun 2008 08:52:22 +0100
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Michael Rimov wrote:
> So here’s my problem:
>
>
>
> Since Hibernate Session is a request scope, that means:
>
> · SomeDao depends on Hibernate Session, it must reside in
> Request Scope
>
> · SomeService depends on SomeDao which depends on Hibernate: it
> must reside in Request Scope
>
> · And finally, SomeController depends on SomeService which
> depends on SomeDao which depends on Hibernate: therefore it must reside
> in the Request Scope.
>
IMO this is the key aristotelic syllogism: it depends on hibernate
therefore it must reside in (webapp) request scope.
Why do you assume this? You can happily have a persister/dao living in
application scope and it will fire off different hibernate requests.
I tend to have most dependencies living in app scope and only use
session or request when strictly necessary.
Am I missing something?
Cheers
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email