-
1. Re: Understanding conversations
nickarls Oct 21, 2008 11:09 AM (in response to charlscross)Try here
-
2. Re: Understanding conversations
charlscross Oct 21, 2008 11:12 AM (in response to charlscross)Whoooa!!! Thanks!
-
3. Re: Understanding conversations
charlscross Oct 21, 2008 1:47 PM (in response to charlscross)Ok.
I understand that a conversation is need for keep objects in memory from an user action's starts until this action ends.If my aim is to keep the select items choice until the session ends, no matter what other things the user is doing, will be best to use a session scoped bean??
Or can I put just the vars that control the selectitems choice to the session context and keep the rest of the bean variables in the conversation context??
-
4. Re: Understanding conversations
gjeudy Oct 21, 2008 2:53 PM (in response to charlscross)
Charls Cross wrote on Oct 21, 2008 13:47:
Ok.
I understand that a conversation is need for keep objects in memory from an user action's starts until this action ends.
If my aim is to keep the select items choice until the session ends, no matter what other things the user is doing, will be best to use a session scoped bean??Yes the session scope seems more appropriate in this case. The conversation scope is only good to cache data for the duration of a usecase.
Or can I put just the vars that control the selectitems choice to the session context and keep the rest of the bean variables in the conversation context??You can do that as well. Read more on bijection, the contexts live independent of the bean's declared @Scope. For example you can have a conversation-scoped bean that outjects some variables to session context and other variables to conversation context.
@Name("myBean") @Scope(ScopeType.CONVERSATION) public class MyBean { @Out(scope=ScopeType.SESSION) private MyType myvar; @Out private MyType myvarInheritsScopeFromBean; // which is conversation scope ... }
-
5. Re: Understanding conversations
charlscross Oct 21, 2008 3:03 PM (in response to charlscross)Thanks, you helped me!
One last question, annotating a variable with @Out is just the same than writing a getter method, and the same for @In and setter method? Well, it's just what I understood after reading the reference doc, but If I'm in a mistake please help me... -
6. Re: Understanding conversations
gjeudy Oct 21, 2008 3:21 PM (in response to charlscross)No it is not the same because having getter/setter leaves the variable populated in your bean instance. Comparatively using @In/@Out injects a variable from a context or outjects a variable to a context on every method call to your seam managed bean.
Bijection will always disinject the variables at the end of the method call effectively nulling them out.
I strongly recommend that you buy a book to get you started with the core concepts of Seam. Seam in Action from Manning is great and is a good complement to the reference documentation.
-
7. Re: Understanding conversations
charlscross Oct 21, 2008 3:37 PM (in response to charlscross)Thanks, just today started with it!! Yes, I think I need to understanding the core concepts better, I'm always getting the things work but with little understanding... It's time to start from beginning..