[jboss-user] [JBoss Seam] - Another conversation question: how to correctly begin one??

MSchmidke do-not-reply at jboss.com
Sun Jan 20 06:00:57 EST 2008


There are a lot of possibilities for starting a conversation, but I still am not sure which is the best for the most cases. What do you think?

1. Beginning a conversation by action method

  | public class MainMenuBean {
  | 
  |   @Begin(flushMode=FlushModeType.MANUAL)
  |   public String doUsecase1() {
  |     return "/pages/usecase1";
  |   }
  | 
  |   @Begin(flushMode=FlushModeType.MANUAL)
  |   public String doUsecase2() {
  |     return "/pages/usecase2";
  |   }
  | }
  | 

- violates DRY (specify flushmode everytime, for example)
- scatters business logic (why should my menu bean be aware of the flushmode my component intends to use?)

2. Beginning a conversation by <begin-conversation flush-mode="MANUAL"> in pages.xml.
- violates DRY
- scatters business logic (program logic details in a xml file? why??).
- impossible to reload the page ("begin called from long running ...")

3. Create a page action method annotated with @Begin(flushMode=MANUAL)
+ Parameters concerning program logic at the right place (in the class which makes use of their functionality)
+ DRY-aware (put page action method in a common base class)
- impossible to reload the page

4. Use #{conversation.begin}
- same as 2

5. Annotate the @Create method with @Begin
+ Parameters at the right place
+ DRY
+ possible to reload the page

Until yesterday, I feeled that (5) was the best possibility, but as you have probably read, I found out that this does not work with page parameters. In fact, (1) seems to be the only variant which works in that situation.

What do you use?


Marcus.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121598#4121598

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121598



More information about the jboss-user mailing list