-Igor
On 3/30/06, Vincent Jenks <
[EMAIL PROTECTED]> wrote:
OK, I'll check into it, thanks. Meanwhile, if I *did* want to...I could pass the cart stub around in the constructors, couldn't I? Or, is this somehow not safe?
I'm thinking that might be the quickest, easiest approach for now. I only need it for a few pages.On 3/30/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:i didnt say introduce spring as a dependency.
i said look at how wicket-spring injects special proxies into wicket components that you can safely store in session, etc
it will take very little tweaking to make it work for ejb3.
look at the Spring page on the wiki to see why the proxies exist and how they work.
wicket-spring provides an elegant solution, but only a tiny portion of it is spring related.
-IgorOn 3/30/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:I'd rather not introduce spring as yet another dependency on this project...especially because I know very little about it and don't have the time to tinker w/ it for this project.
What about passing the ShoppingCart EJB stub around in my page constructors instead of using a getter/setter in my custom UserSession class? Wouldn't that be safe?On 3/29/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:you can inject the proxy into any component
look at wicket-spring project
you can create a IFieldValueFactory that injects a proxy for your stateful bean.
-IgorOn 3/29/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:I'm sitting here, pondering, and getting fatter. I'm building a storefront app w/ a simple shopping cart for which I'm thinking of using a Stateful session bean (EJB 3.0).
It looks like, no matter how I look at it, I'll have to keep the SFSB stub in-session throughout its use in the application...and I'm not sure of a real elegant way of doing that. So, I was just hoping someone here could provide some insight.
In Wicket, I've already got a class called UserSession which I use to pass around an User so I can test whether or not a page is accessible by certain user groups. I decided, to keep it simple, that I'd add a getter & setter for my ShoppingCart stub in the same class so it could be passed around in-session w/ the User, since each shopper will have an User automatically created for them before checking out and paying.
The problem w/ all this SFSB business is; it violates my design because I have to make my web tier talk directly to my session bean in order to keep track of its state. For everything else I've been using a handful of proxy classes where I could place calls to my session beans and other business logic.
It looks a little like this:
Wicket->ProxyClass->SessionBean->Database
So, now I'll have to keep track of the ShoppingCart stub class in Wicket, pass the ShoppingCart and the users' chosen form values into the Proxy, perform business logic, and then return a ShoppingCart which I'll have to place *back* into the UserSession.setCart() method to continue to keep track of the state of the users' carts.
This is kinda nasty, is there an easier (or just more elegant) way to do this?
Thanks all!