|
From: Erwin V. <erw...@er...> - 2005-05-05 14:26:31
|
One way to make it more elegant is to use an object initialisation callback
interface. That way the controllers can pass this initialisation strategy
into the service layer, which will call it to initialize any objects
("excercizing" the lazy associations) it returns back to the controller. As
a result you have a situation where
1) the controllers "define" (by implementing the initialisation callback
interface, mostly using an anonymous inner class) how to initialize the
objects retreived from the service layer, which can be specific to that
controller and its views
2) no explosion of methods on the service layer to support all possible
usage scenarios by the controllers
3) for optimisation you still have the option of defining a specialized
service method which is backed by a specialized query
Erwin Vervaet
erw...@er...
----- Original Message -----
From: "James Cook" <jim...@do...>
To: <spr...@li...>
Sent: Thursday, May 05, 2005 3:11 PM
Subject: RE: [Springframework-developer] Re: [Springframework-user] Delayed
association of transaction with session
That's the thread where I described a service layer approach that we began
using when we ditched OSIV. We give our web-tier a service layer to interact
with that defines a transactional boundary.
It worked very well for us, except for the problem that Ugo Cei brought up
regarding the ugliness of pre-loading lazy-loaded collections. Not really a
problem, but not so elegant.
jim
> -----Original Message-----
> > There are other workarounds that may be jammed in, but the ones I can
> > think
> > up are not exactly elegant. Perhaps this is simply a case of developer
> > beware; a known side-effect to using the OSIV approach to web
> development.
> > I'd appreciate any advice on whether the framework can be coerced to
> > eliminate one of the remaining flaws in this pattern.
>
> Also take a look at the following discussion, which details more of the
> issues of OSIV:
>
> http://www.newsarch.com/archive/mailinglist/comp/java/springframework/user
> /msg03641.html
>
> Erwin
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|