Hi Yee,
> I think this pretty confirms that binding
> to domain model pattern is indeed not
> tenable for 3 tier architecture.
Again, I'd say your problems lie in how you've configured Hibernate :
> We are using Hibernate Spring MVC
> with OpenSessionInView filter.
In all of the projects I have worked on, we've always steered clear of the
"Lazy Instanciation" pattern in favor of forcing the developer to think hard
about what he needs to 'fetch'. So going through the layers we have :
1. Stripes ActionBeans do there thing (including binding to domain)
2. SpringInterceptor injects Service objects via @SpringBean
3. Spring is configured to open/commit transactions (rollback if exception) on
certain Service method naming patterns eg.
find*
update*
persist*
4. DAOs are injected into Service objects.
5. DAOs must "fetch" all needed data (no lazy instatiation from view).
6. DAOs use a generic (in the Java 'Generics' sense) base class for all basic
functionality.
Therefore, prebinding in conjunction with @StrictBinding and @Validation will
leave the id property untouched, and your Service objects use their own
transactions. It's what we've used and it works.
Cheers,
DJDaveMark
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users