ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Fotiou" <Mike.Fot...@pwgsc.gc.ca>
Subject Reload Lazy Objects
Date Wed, 29 Jun 2005 16:51:25 GMT
Is there any way in IBATIS to mark an object that was lazy-loaded as "unloaded" so that the
object will be reloaded again?  I'm thinking about the following scenario:
Domain Objects:  
User contains Role objects (a List)
Sevice Object:
UserService.removeUserRole(User u, String roleCode);
DAO Object:
The service object now has to manage the User object's List of roles.  Ideally, this List
would be immutable, but otherwise the service object has to iterate through the List and remove
the appropriate Role object.  I could add a removeRole() method on the User object, but that
is a little confusing, as there is a removeUserRole on the ServiceObject.  I do not want to
allow the domain objects access to the DAO layer, that's the reason for the service layer.
 I'm considering scrapping the service layer altogether in favour of heavy-weight domain objects
that can manage their own collections easily.
Any ideas?

View raw message